@effected/yaml 0.25.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/Yaml.js +5 -2
- package/YamlDiagnostic.js +33 -31
- package/YamlDocument.js +17 -11
- package/YamlLint.js +26 -35
- package/YamlToken.js +25 -15
- package/YamlVisitor.js +7 -6
- package/index.d.ts +98 -493
- package/index.js +2 -1
- package/internal/composer/scalars.js +18 -3
- package/internal/composer/state.js +3 -1
- package/internal/cst-parser.js +3 -1
- package/internal/lexer.js +4 -1
- package/internal/line-breaks.js +12 -0
- package/internal/rules/colon-spacing.js +30 -20
- package/internal/rules/comments-spacing.js +10 -3
- package/internal/rules/document-end.js +3 -2
- package/internal/rules/empty-lines.js +12 -3
- package/internal/rules/eof-newline.js +2 -1
- package/internal/rules/hyphen-spacing.js +20 -14
- package/internal/rules/trailing-spaces.js +2 -2
- package/internal/rules/util.js +92 -1
- package/package.json +5 -2
- package/tsdoc-metadata.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LineBreaks, LineIndex, LineIndexOptions, SourceDiagnostic, SourceIndex, SourceIndex as SourceIndex$1, SourceLocation, SourcePosition, SourceRange, SourceSpan } from "@effected/source";
|
|
1
2
|
import { Data, Effect, Option, Result, Schema, Stream } from "effect";
|
|
2
3
|
/**
|
|
3
4
|
* Error codes emitted by the lexer stage.
|
|
@@ -91,9 +92,16 @@ declare const YamlDiagnostic_base: Schema.Class<YamlDiagnostic, Schema.Struct<{
|
|
|
91
92
|
* fatality is a property of the code — see {@link YamlDiagnostic.isFatal}.
|
|
92
93
|
*
|
|
93
94
|
* @remarks
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
95
|
+
* Satisfies `@effected/source`'s `SourceDiagnostic<YamlErrorCode>`: the
|
|
96
|
+
* positional core (`code`/`message`/`offset`/`length`/`line`/`character`)
|
|
97
|
+
* the kit's format packages share, so a consumer printing or serving
|
|
98
|
+
* diagnostics (an LSP server, a CLI annotation) is written once against that
|
|
99
|
+
* shape. `line`/`character` are zero-based, `character` in UTF-16 code units,
|
|
100
|
+
* with `\n`, `\r\n` and a bare `\r` as line breaks, YAML 1.2's own
|
|
101
|
+
* `b-break` set: exactly `LineIndex.make(text).positionAt(offset)`. U+2028
|
|
102
|
+
* and U+2029 are not line breaks (YAML 1.2 dropped them, the lexer never
|
|
103
|
+
* treated them as one, and neither does an LSP client), and an offset at the
|
|
104
|
+
* `\n` of a `\r\n` reads as the end of its line.
|
|
97
105
|
*
|
|
98
106
|
* @public
|
|
99
107
|
*/
|
|
@@ -112,8 +120,16 @@ export declare class YamlDiagnostic extends YamlDiagnostic_base {
|
|
|
112
120
|
* deriving `line`/`character` from `offset` against the source `text`.
|
|
113
121
|
* Advanced — the parse/stringify entry points call this for you.
|
|
114
122
|
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* Pass a line index already built over the source to materialize many
|
|
125
|
+
* records without rescanning the text; a string builds one. The
|
|
126
|
+
* parameter is the structural `SourceIndex`, so an index from any
|
|
127
|
+
* installed copy of `@effected/source` is accepted. An offset
|
|
128
|
+
* outside the source clamps into it, as `LineIndex.positionAt` does.
|
|
129
|
+
*
|
|
115
130
|
* @param raw - The engine record: `code`, `message`, `offset` and `length`.
|
|
116
|
-
* @param text - The source text the record's `offset` indexes into
|
|
131
|
+
* @param text - The source text the record's `offset` indexes into, or a
|
|
132
|
+
* `LineIndex` over it.
|
|
117
133
|
* @returns The diagnostic with `line` and `character` filled in.
|
|
118
134
|
*/
|
|
119
135
|
static fromRaw(raw: {
|
|
@@ -121,7 +137,7 @@ export declare class YamlDiagnostic extends YamlDiagnostic_base {
|
|
|
121
137
|
readonly message: string;
|
|
122
138
|
readonly offset: number;
|
|
123
139
|
readonly length: number;
|
|
124
|
-
}, text: string): YamlDiagnostic;
|
|
140
|
+
}, text: string | SourceIndex$1): YamlDiagnostic;
|
|
125
141
|
}
|
|
126
142
|
declare const YamlParseOptions_base: Schema.Class<YamlParseOptions, Schema.Struct<{
|
|
127
143
|
readonly strict: Schema.optionalKey<Schema.Boolean>;
|
|
@@ -1597,6 +1613,13 @@ declare const YamlToken_base: Schema.Class<YamlToken, Schema.Struct<{
|
|
|
1597
1613
|
* - `line` / `character` — the zero-based position of the token's start,
|
|
1598
1614
|
* matching the `YamlDiagnostic` position vocabulary.
|
|
1599
1615
|
*
|
|
1616
|
+
* @remarks
|
|
1617
|
+
* Satisfies `@effected/source`'s `SourceLocation`. `line` / `character` are
|
|
1618
|
+
* `LineIndex.make(source).positionAt(offset)`: zero-based, UTF-16 code
|
|
1619
|
+
* units, with `\n`, `\r\n` and a bare `\r` as line breaks (YAML 1.2's
|
|
1620
|
+
* `b-break`, the set the lexer emits a `newline` token for), so a token and a
|
|
1621
|
+
* `YamlDiagnostic` at the same offset always agree.
|
|
1622
|
+
*
|
|
1600
1623
|
* @public
|
|
1601
1624
|
*/
|
|
1602
1625
|
export declare class YamlToken extends YamlToken_base {}
|
|
@@ -2173,495 +2196,77 @@ export type YamlVisitorEvent = Data.TaggedEnum<{
|
|
|
2173
2196
|
*
|
|
2174
2197
|
* @public
|
|
2175
2198
|
*/
|
|
2176
|
-
export declare const YamlVisitorEvent: {
|
|
2177
|
-
readonly
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2199
|
+
export declare const YamlVisitorEvent: Data.TaggedEnum.Constructor<{
|
|
2200
|
+
readonly _tag: "Alias";
|
|
2201
|
+
readonly path: YamlPath;
|
|
2202
|
+
readonly depth: number;
|
|
2203
|
+
readonly name: string;
|
|
2204
|
+
} | {
|
|
2205
|
+
readonly _tag: "Comment";
|
|
2206
|
+
readonly path: YamlPath;
|
|
2207
|
+
readonly depth: number;
|
|
2208
|
+
readonly text: string;
|
|
2209
|
+
readonly placement: "leading" | "trailing";
|
|
2210
|
+
} | {
|
|
2211
|
+
readonly _tag: "Directive";
|
|
2212
|
+
readonly path: YamlPath;
|
|
2213
|
+
readonly depth: number;
|
|
2214
|
+
readonly name: string;
|
|
2215
|
+
readonly parameters: string;
|
|
2216
|
+
} | {
|
|
2217
|
+
readonly _tag: "DocumentEnd";
|
|
2218
|
+
readonly path: YamlPath;
|
|
2219
|
+
readonly depth: number;
|
|
2220
|
+
} | {
|
|
2221
|
+
readonly _tag: "DocumentStart";
|
|
2222
|
+
readonly path: YamlPath;
|
|
2223
|
+
readonly depth: number;
|
|
2224
|
+
readonly directives: ReadonlyArray<{
|
|
2196
2225
|
readonly name: string;
|
|
2197
|
-
readonly parameters: string
|
|
2198
|
-
}, {
|
|
2199
|
-
readonly _tag: Tag;
|
|
2200
|
-
}> | Extract<{
|
|
2201
|
-
readonly _tag: "DocumentEnd";
|
|
2202
|
-
readonly path: YamlPath;
|
|
2203
|
-
readonly depth: number;
|
|
2204
|
-
}, {
|
|
2205
|
-
readonly _tag: Tag;
|
|
2206
|
-
}> | Extract<{
|
|
2207
|
-
readonly _tag: "DocumentStart";
|
|
2208
|
-
readonly path: YamlPath;
|
|
2209
|
-
readonly depth: number;
|
|
2210
|
-
readonly directives: ReadonlyArray<{
|
|
2211
|
-
readonly name: string;
|
|
2212
|
-
readonly parameters: ReadonlyArray<string>;
|
|
2213
|
-
}>;
|
|
2214
|
-
}, {
|
|
2215
|
-
readonly _tag: Tag;
|
|
2216
|
-
}> | Extract<{
|
|
2217
|
-
readonly _tag: "Error";
|
|
2218
|
-
readonly path: YamlPath;
|
|
2219
|
-
readonly depth: number;
|
|
2220
|
-
readonly diagnostic: YamlDiagnostic;
|
|
2221
|
-
}, {
|
|
2222
|
-
readonly _tag: Tag;
|
|
2223
|
-
}> | Extract<{
|
|
2224
|
-
readonly _tag: "MapEnd";
|
|
2225
|
-
readonly path: YamlPath;
|
|
2226
|
-
readonly depth: number;
|
|
2227
|
-
}, {
|
|
2228
|
-
readonly _tag: Tag;
|
|
2229
|
-
}> | Extract<{
|
|
2230
|
-
readonly _tag: "MapStart";
|
|
2231
|
-
readonly path: YamlPath;
|
|
2232
|
-
readonly depth: number;
|
|
2233
|
-
readonly style: CollectionStyle;
|
|
2234
|
-
readonly tag?: string;
|
|
2235
|
-
readonly anchor?: string;
|
|
2236
|
-
}, {
|
|
2237
|
-
readonly _tag: Tag;
|
|
2238
|
-
}> | Extract<{
|
|
2239
|
-
readonly _tag: "Pair";
|
|
2240
|
-
readonly path: YamlPath;
|
|
2241
|
-
readonly depth: number;
|
|
2242
|
-
readonly key: unknown;
|
|
2243
|
-
readonly value: unknown;
|
|
2244
|
-
}, {
|
|
2245
|
-
readonly _tag: Tag;
|
|
2246
|
-
}> | Extract<{
|
|
2247
|
-
readonly _tag: "Scalar";
|
|
2248
|
-
readonly path: YamlPath;
|
|
2249
|
-
readonly depth: number;
|
|
2250
|
-
readonly value: unknown;
|
|
2251
|
-
readonly style: ScalarStyle;
|
|
2252
|
-
readonly tag?: string;
|
|
2253
|
-
readonly anchor?: string;
|
|
2254
|
-
}, {
|
|
2255
|
-
readonly _tag: Tag;
|
|
2256
|
-
}> | Extract<{
|
|
2257
|
-
readonly _tag: "SeqEnd";
|
|
2258
|
-
readonly path: YamlPath;
|
|
2259
|
-
readonly depth: number;
|
|
2260
|
-
}, {
|
|
2261
|
-
readonly _tag: Tag;
|
|
2262
|
-
}> | Extract<{
|
|
2263
|
-
readonly _tag: "SeqStart";
|
|
2264
|
-
readonly path: YamlPath;
|
|
2265
|
-
readonly depth: number;
|
|
2266
|
-
readonly style: CollectionStyle;
|
|
2267
|
-
readonly tag?: string;
|
|
2268
|
-
readonly anchor?: string;
|
|
2269
|
-
}, {
|
|
2270
|
-
readonly _tag: Tag;
|
|
2226
|
+
readonly parameters: ReadonlyArray<string>;
|
|
2271
2227
|
}>;
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
readonly MapEnd: (args: {
|
|
2315
|
-
readonly _tag: "MapEnd";
|
|
2316
|
-
readonly path: YamlPath;
|
|
2317
|
-
readonly depth: number;
|
|
2318
|
-
}) => any;
|
|
2319
|
-
readonly MapStart: (args: {
|
|
2320
|
-
readonly _tag: "MapStart";
|
|
2321
|
-
readonly path: YamlPath;
|
|
2322
|
-
readonly depth: number;
|
|
2323
|
-
readonly style: CollectionStyle;
|
|
2324
|
-
readonly tag?: string;
|
|
2325
|
-
readonly anchor?: string;
|
|
2326
|
-
}) => any;
|
|
2327
|
-
readonly Pair: (args: {
|
|
2328
|
-
readonly _tag: "Pair";
|
|
2329
|
-
readonly path: YamlPath;
|
|
2330
|
-
readonly depth: number;
|
|
2331
|
-
readonly key: unknown;
|
|
2332
|
-
readonly value: unknown;
|
|
2333
|
-
}) => any;
|
|
2334
|
-
readonly Scalar: (args: {
|
|
2335
|
-
readonly _tag: "Scalar";
|
|
2336
|
-
readonly path: YamlPath;
|
|
2337
|
-
readonly depth: number;
|
|
2338
|
-
readonly value: unknown;
|
|
2339
|
-
readonly style: ScalarStyle;
|
|
2340
|
-
readonly tag?: string;
|
|
2341
|
-
readonly anchor?: string;
|
|
2342
|
-
}) => any;
|
|
2343
|
-
readonly SeqEnd: (args: {
|
|
2344
|
-
readonly _tag: "SeqEnd";
|
|
2345
|
-
readonly path: YamlPath;
|
|
2346
|
-
readonly depth: number;
|
|
2347
|
-
}) => any;
|
|
2348
|
-
readonly SeqStart: (args: {
|
|
2349
|
-
readonly _tag: "SeqStart";
|
|
2350
|
-
readonly path: YamlPath;
|
|
2351
|
-
readonly depth: number;
|
|
2352
|
-
readonly style: CollectionStyle;
|
|
2353
|
-
readonly tag?: string;
|
|
2354
|
-
readonly anchor?: string;
|
|
2355
|
-
}) => any;
|
|
2356
|
-
}>(cases: Cases): (value: {
|
|
2357
|
-
readonly _tag: "Alias";
|
|
2358
|
-
readonly path: YamlPath;
|
|
2359
|
-
readonly depth: number;
|
|
2360
|
-
readonly name: string;
|
|
2361
|
-
} | {
|
|
2362
|
-
readonly _tag: "Comment";
|
|
2363
|
-
readonly path: YamlPath;
|
|
2364
|
-
readonly depth: number;
|
|
2365
|
-
readonly text: string;
|
|
2366
|
-
readonly placement: "leading" | "trailing";
|
|
2367
|
-
} | {
|
|
2368
|
-
readonly _tag: "Directive";
|
|
2369
|
-
readonly path: YamlPath;
|
|
2370
|
-
readonly depth: number;
|
|
2371
|
-
readonly name: string;
|
|
2372
|
-
readonly parameters: string;
|
|
2373
|
-
} | {
|
|
2374
|
-
readonly _tag: "DocumentEnd";
|
|
2375
|
-
readonly path: YamlPath;
|
|
2376
|
-
readonly depth: number;
|
|
2377
|
-
} | {
|
|
2378
|
-
readonly _tag: "DocumentStart";
|
|
2379
|
-
readonly path: YamlPath;
|
|
2380
|
-
readonly depth: number;
|
|
2381
|
-
readonly directives: ReadonlyArray<{
|
|
2382
|
-
readonly name: string;
|
|
2383
|
-
readonly parameters: ReadonlyArray<string>;
|
|
2384
|
-
}>;
|
|
2385
|
-
} | {
|
|
2386
|
-
readonly _tag: "Error";
|
|
2387
|
-
readonly path: YamlPath;
|
|
2388
|
-
readonly depth: number;
|
|
2389
|
-
readonly diagnostic: YamlDiagnostic;
|
|
2390
|
-
} | {
|
|
2391
|
-
readonly _tag: "MapEnd";
|
|
2392
|
-
readonly path: YamlPath;
|
|
2393
|
-
readonly depth: number;
|
|
2394
|
-
} | {
|
|
2395
|
-
readonly _tag: "MapStart";
|
|
2396
|
-
readonly path: YamlPath;
|
|
2397
|
-
readonly depth: number;
|
|
2398
|
-
readonly style: CollectionStyle;
|
|
2399
|
-
readonly tag?: string;
|
|
2400
|
-
readonly anchor?: string;
|
|
2401
|
-
} | {
|
|
2402
|
-
readonly _tag: "Pair";
|
|
2403
|
-
readonly path: YamlPath;
|
|
2404
|
-
readonly depth: number;
|
|
2405
|
-
readonly key: unknown;
|
|
2406
|
-
readonly value: unknown;
|
|
2407
|
-
} | {
|
|
2408
|
-
readonly _tag: "Scalar";
|
|
2409
|
-
readonly path: YamlPath;
|
|
2410
|
-
readonly depth: number;
|
|
2411
|
-
readonly value: unknown;
|
|
2412
|
-
readonly style: ScalarStyle;
|
|
2413
|
-
readonly tag?: string;
|
|
2414
|
-
readonly anchor?: string;
|
|
2415
|
-
} | {
|
|
2416
|
-
readonly _tag: "SeqEnd";
|
|
2417
|
-
readonly path: YamlPath;
|
|
2418
|
-
readonly depth: number;
|
|
2419
|
-
} | {
|
|
2420
|
-
readonly _tag: "SeqStart";
|
|
2421
|
-
readonly path: YamlPath;
|
|
2422
|
-
readonly depth: number;
|
|
2423
|
-
readonly style: CollectionStyle;
|
|
2424
|
-
readonly tag?: string;
|
|
2425
|
-
readonly anchor?: string;
|
|
2426
|
-
}) => import("effect/Unify").Unify<ReturnType<Cases["Alias" | "Comment" | "Directive" | "DocumentEnd" | "DocumentStart" | "Error" | "MapEnd" | "MapStart" | "Pair" | "Scalar" | "SeqEnd" | "SeqStart"]>>;
|
|
2427
|
-
<Cases extends {
|
|
2428
|
-
readonly Alias: (args: {
|
|
2429
|
-
readonly _tag: "Alias";
|
|
2430
|
-
readonly path: YamlPath;
|
|
2431
|
-
readonly depth: number;
|
|
2432
|
-
readonly name: string;
|
|
2433
|
-
}) => any;
|
|
2434
|
-
readonly Comment: (args: {
|
|
2435
|
-
readonly _tag: "Comment";
|
|
2436
|
-
readonly path: YamlPath;
|
|
2437
|
-
readonly depth: number;
|
|
2438
|
-
readonly text: string;
|
|
2439
|
-
readonly placement: "leading" | "trailing";
|
|
2440
|
-
}) => any;
|
|
2441
|
-
readonly Directive: (args: {
|
|
2442
|
-
readonly _tag: "Directive";
|
|
2443
|
-
readonly path: YamlPath;
|
|
2444
|
-
readonly depth: number;
|
|
2445
|
-
readonly name: string;
|
|
2446
|
-
readonly parameters: string;
|
|
2447
|
-
}) => any;
|
|
2448
|
-
readonly DocumentEnd: (args: {
|
|
2449
|
-
readonly _tag: "DocumentEnd";
|
|
2450
|
-
readonly path: YamlPath;
|
|
2451
|
-
readonly depth: number;
|
|
2452
|
-
}) => any;
|
|
2453
|
-
readonly DocumentStart: (args: {
|
|
2454
|
-
readonly _tag: "DocumentStart";
|
|
2455
|
-
readonly path: YamlPath;
|
|
2456
|
-
readonly depth: number;
|
|
2457
|
-
readonly directives: ReadonlyArray<{
|
|
2458
|
-
readonly name: string;
|
|
2459
|
-
readonly parameters: ReadonlyArray<string>;
|
|
2460
|
-
}>;
|
|
2461
|
-
}) => any;
|
|
2462
|
-
readonly Error: (args: {
|
|
2463
|
-
readonly _tag: "Error";
|
|
2464
|
-
readonly path: YamlPath;
|
|
2465
|
-
readonly depth: number;
|
|
2466
|
-
readonly diagnostic: YamlDiagnostic;
|
|
2467
|
-
}) => any;
|
|
2468
|
-
readonly MapEnd: (args: {
|
|
2469
|
-
readonly _tag: "MapEnd";
|
|
2470
|
-
readonly path: YamlPath;
|
|
2471
|
-
readonly depth: number;
|
|
2472
|
-
}) => any;
|
|
2473
|
-
readonly MapStart: (args: {
|
|
2474
|
-
readonly _tag: "MapStart";
|
|
2475
|
-
readonly path: YamlPath;
|
|
2476
|
-
readonly depth: number;
|
|
2477
|
-
readonly style: CollectionStyle;
|
|
2478
|
-
readonly tag?: string;
|
|
2479
|
-
readonly anchor?: string;
|
|
2480
|
-
}) => any;
|
|
2481
|
-
readonly Pair: (args: {
|
|
2482
|
-
readonly _tag: "Pair";
|
|
2483
|
-
readonly path: YamlPath;
|
|
2484
|
-
readonly depth: number;
|
|
2485
|
-
readonly key: unknown;
|
|
2486
|
-
readonly value: unknown;
|
|
2487
|
-
}) => any;
|
|
2488
|
-
readonly Scalar: (args: {
|
|
2489
|
-
readonly _tag: "Scalar";
|
|
2490
|
-
readonly path: YamlPath;
|
|
2491
|
-
readonly depth: number;
|
|
2492
|
-
readonly value: unknown;
|
|
2493
|
-
readonly style: ScalarStyle;
|
|
2494
|
-
readonly tag?: string;
|
|
2495
|
-
readonly anchor?: string;
|
|
2496
|
-
}) => any;
|
|
2497
|
-
readonly SeqEnd: (args: {
|
|
2498
|
-
readonly _tag: "SeqEnd";
|
|
2499
|
-
readonly path: YamlPath;
|
|
2500
|
-
readonly depth: number;
|
|
2501
|
-
}) => any;
|
|
2502
|
-
readonly SeqStart: (args: {
|
|
2503
|
-
readonly _tag: "SeqStart";
|
|
2504
|
-
readonly path: YamlPath;
|
|
2505
|
-
readonly depth: number;
|
|
2506
|
-
readonly style: CollectionStyle;
|
|
2507
|
-
readonly tag?: string;
|
|
2508
|
-
readonly anchor?: string;
|
|
2509
|
-
}) => any;
|
|
2510
|
-
}>(value: {
|
|
2511
|
-
readonly _tag: "Alias";
|
|
2512
|
-
readonly path: YamlPath;
|
|
2513
|
-
readonly depth: number;
|
|
2514
|
-
readonly name: string;
|
|
2515
|
-
} | {
|
|
2516
|
-
readonly _tag: "Comment";
|
|
2517
|
-
readonly path: YamlPath;
|
|
2518
|
-
readonly depth: number;
|
|
2519
|
-
readonly text: string;
|
|
2520
|
-
readonly placement: "leading" | "trailing";
|
|
2521
|
-
} | {
|
|
2522
|
-
readonly _tag: "Directive";
|
|
2523
|
-
readonly path: YamlPath;
|
|
2524
|
-
readonly depth: number;
|
|
2525
|
-
readonly name: string;
|
|
2526
|
-
readonly parameters: string;
|
|
2527
|
-
} | {
|
|
2528
|
-
readonly _tag: "DocumentEnd";
|
|
2529
|
-
readonly path: YamlPath;
|
|
2530
|
-
readonly depth: number;
|
|
2531
|
-
} | {
|
|
2532
|
-
readonly _tag: "DocumentStart";
|
|
2533
|
-
readonly path: YamlPath;
|
|
2534
|
-
readonly depth: number;
|
|
2535
|
-
readonly directives: ReadonlyArray<{
|
|
2536
|
-
readonly name: string;
|
|
2537
|
-
readonly parameters: ReadonlyArray<string>;
|
|
2538
|
-
}>;
|
|
2539
|
-
} | {
|
|
2540
|
-
readonly _tag: "Error";
|
|
2541
|
-
readonly path: YamlPath;
|
|
2542
|
-
readonly depth: number;
|
|
2543
|
-
readonly diagnostic: YamlDiagnostic;
|
|
2544
|
-
} | {
|
|
2545
|
-
readonly _tag: "MapEnd";
|
|
2546
|
-
readonly path: YamlPath;
|
|
2547
|
-
readonly depth: number;
|
|
2548
|
-
} | {
|
|
2549
|
-
readonly _tag: "MapStart";
|
|
2550
|
-
readonly path: YamlPath;
|
|
2551
|
-
readonly depth: number;
|
|
2552
|
-
readonly style: CollectionStyle;
|
|
2553
|
-
readonly tag?: string;
|
|
2554
|
-
readonly anchor?: string;
|
|
2555
|
-
} | {
|
|
2556
|
-
readonly _tag: "Pair";
|
|
2557
|
-
readonly path: YamlPath;
|
|
2558
|
-
readonly depth: number;
|
|
2559
|
-
readonly key: unknown;
|
|
2560
|
-
readonly value: unknown;
|
|
2561
|
-
} | {
|
|
2562
|
-
readonly _tag: "Scalar";
|
|
2563
|
-
readonly path: YamlPath;
|
|
2564
|
-
readonly depth: number;
|
|
2565
|
-
readonly value: unknown;
|
|
2566
|
-
readonly style: ScalarStyle;
|
|
2567
|
-
readonly tag?: string;
|
|
2568
|
-
readonly anchor?: string;
|
|
2569
|
-
} | {
|
|
2570
|
-
readonly _tag: "SeqEnd";
|
|
2571
|
-
readonly path: YamlPath;
|
|
2572
|
-
readonly depth: number;
|
|
2573
|
-
} | {
|
|
2574
|
-
readonly _tag: "SeqStart";
|
|
2575
|
-
readonly path: YamlPath;
|
|
2576
|
-
readonly depth: number;
|
|
2577
|
-
readonly style: CollectionStyle;
|
|
2578
|
-
readonly tag?: string;
|
|
2579
|
-
readonly anchor?: string;
|
|
2580
|
-
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Alias" | "Comment" | "Directive" | "DocumentEnd" | "DocumentStart" | "Error" | "MapEnd" | "MapStart" | "Pair" | "Scalar" | "SeqEnd" | "SeqStart"]>>;
|
|
2581
|
-
};
|
|
2582
|
-
readonly Alias: Data.TaggedEnum.ConstructorFrom<{
|
|
2583
|
-
readonly _tag: "Alias";
|
|
2584
|
-
readonly path: YamlPath;
|
|
2585
|
-
readonly depth: number;
|
|
2586
|
-
readonly name: string;
|
|
2587
|
-
}, "_tag">;
|
|
2588
|
-
readonly Comment: Data.TaggedEnum.ConstructorFrom<{
|
|
2589
|
-
readonly _tag: "Comment";
|
|
2590
|
-
readonly path: YamlPath;
|
|
2591
|
-
readonly depth: number;
|
|
2592
|
-
readonly text: string;
|
|
2593
|
-
readonly placement: "leading" | "trailing";
|
|
2594
|
-
}, "_tag">;
|
|
2595
|
-
readonly Directive: Data.TaggedEnum.ConstructorFrom<{
|
|
2596
|
-
readonly _tag: "Directive";
|
|
2597
|
-
readonly path: YamlPath;
|
|
2598
|
-
readonly depth: number;
|
|
2599
|
-
readonly name: string;
|
|
2600
|
-
readonly parameters: string;
|
|
2601
|
-
}, "_tag">;
|
|
2602
|
-
readonly DocumentEnd: Data.TaggedEnum.ConstructorFrom<{
|
|
2603
|
-
readonly _tag: "DocumentEnd";
|
|
2604
|
-
readonly path: YamlPath;
|
|
2605
|
-
readonly depth: number;
|
|
2606
|
-
}, "_tag">;
|
|
2607
|
-
readonly DocumentStart: Data.TaggedEnum.ConstructorFrom<{
|
|
2608
|
-
readonly _tag: "DocumentStart";
|
|
2609
|
-
readonly path: YamlPath;
|
|
2610
|
-
readonly depth: number;
|
|
2611
|
-
readonly directives: ReadonlyArray<{
|
|
2612
|
-
readonly name: string;
|
|
2613
|
-
readonly parameters: ReadonlyArray<string>;
|
|
2614
|
-
}>;
|
|
2615
|
-
}, "_tag">;
|
|
2616
|
-
readonly Error: Data.TaggedEnum.ConstructorFrom<{
|
|
2617
|
-
readonly _tag: "Error";
|
|
2618
|
-
readonly path: YamlPath;
|
|
2619
|
-
readonly depth: number;
|
|
2620
|
-
readonly diagnostic: YamlDiagnostic;
|
|
2621
|
-
}, "_tag">;
|
|
2622
|
-
readonly MapEnd: Data.TaggedEnum.ConstructorFrom<{
|
|
2623
|
-
readonly _tag: "MapEnd";
|
|
2624
|
-
readonly path: YamlPath;
|
|
2625
|
-
readonly depth: number;
|
|
2626
|
-
}, "_tag">;
|
|
2627
|
-
readonly MapStart: Data.TaggedEnum.ConstructorFrom<{
|
|
2628
|
-
readonly _tag: "MapStart";
|
|
2629
|
-
readonly path: YamlPath;
|
|
2630
|
-
readonly depth: number;
|
|
2631
|
-
readonly style: CollectionStyle;
|
|
2632
|
-
readonly tag?: string;
|
|
2633
|
-
readonly anchor?: string;
|
|
2634
|
-
}, "_tag">;
|
|
2635
|
-
readonly Pair: Data.TaggedEnum.ConstructorFrom<{
|
|
2636
|
-
readonly _tag: "Pair";
|
|
2637
|
-
readonly path: YamlPath;
|
|
2638
|
-
readonly depth: number;
|
|
2639
|
-
readonly key: unknown;
|
|
2640
|
-
readonly value: unknown;
|
|
2641
|
-
}, "_tag">;
|
|
2642
|
-
readonly Scalar: Data.TaggedEnum.ConstructorFrom<{
|
|
2643
|
-
readonly _tag: "Scalar";
|
|
2644
|
-
readonly path: YamlPath;
|
|
2645
|
-
readonly depth: number;
|
|
2646
|
-
readonly value: unknown;
|
|
2647
|
-
readonly style: ScalarStyle;
|
|
2648
|
-
readonly tag?: string;
|
|
2649
|
-
readonly anchor?: string;
|
|
2650
|
-
}, "_tag">;
|
|
2651
|
-
readonly SeqEnd: Data.TaggedEnum.ConstructorFrom<{
|
|
2652
|
-
readonly _tag: "SeqEnd";
|
|
2653
|
-
readonly path: YamlPath;
|
|
2654
|
-
readonly depth: number;
|
|
2655
|
-
}, "_tag">;
|
|
2656
|
-
readonly SeqStart: Data.TaggedEnum.ConstructorFrom<{
|
|
2657
|
-
readonly _tag: "SeqStart";
|
|
2658
|
-
readonly path: YamlPath;
|
|
2659
|
-
readonly depth: number;
|
|
2660
|
-
readonly style: CollectionStyle;
|
|
2661
|
-
readonly tag?: string;
|
|
2662
|
-
readonly anchor?: string;
|
|
2663
|
-
}, "_tag">;
|
|
2664
|
-
};
|
|
2228
|
+
} | {
|
|
2229
|
+
readonly _tag: "Error";
|
|
2230
|
+
readonly path: YamlPath;
|
|
2231
|
+
readonly depth: number;
|
|
2232
|
+
readonly diagnostic: YamlDiagnostic;
|
|
2233
|
+
} | {
|
|
2234
|
+
readonly _tag: "MapEnd";
|
|
2235
|
+
readonly path: YamlPath;
|
|
2236
|
+
readonly depth: number;
|
|
2237
|
+
} | {
|
|
2238
|
+
readonly _tag: "MapStart";
|
|
2239
|
+
readonly path: YamlPath;
|
|
2240
|
+
readonly depth: number;
|
|
2241
|
+
readonly style: CollectionStyle;
|
|
2242
|
+
readonly tag?: string;
|
|
2243
|
+
readonly anchor?: string;
|
|
2244
|
+
} | {
|
|
2245
|
+
readonly _tag: "Pair";
|
|
2246
|
+
readonly path: YamlPath;
|
|
2247
|
+
readonly depth: number;
|
|
2248
|
+
readonly key: unknown;
|
|
2249
|
+
readonly value: unknown;
|
|
2250
|
+
} | {
|
|
2251
|
+
readonly _tag: "Scalar";
|
|
2252
|
+
readonly path: YamlPath;
|
|
2253
|
+
readonly depth: number;
|
|
2254
|
+
readonly value: unknown;
|
|
2255
|
+
readonly style: ScalarStyle;
|
|
2256
|
+
readonly tag?: string;
|
|
2257
|
+
readonly anchor?: string;
|
|
2258
|
+
} | {
|
|
2259
|
+
readonly _tag: "SeqEnd";
|
|
2260
|
+
readonly path: YamlPath;
|
|
2261
|
+
readonly depth: number;
|
|
2262
|
+
} | {
|
|
2263
|
+
readonly _tag: "SeqStart";
|
|
2264
|
+
readonly path: YamlPath;
|
|
2265
|
+
readonly depth: number;
|
|
2266
|
+
readonly style: CollectionStyle;
|
|
2267
|
+
readonly tag?: string;
|
|
2268
|
+
readonly anchor?: string;
|
|
2269
|
+
}>;
|
|
2665
2270
|
/**
|
|
2666
2271
|
* Walks YAML text as a lazy `Stream` of typed events — documents, collections,
|
|
2667
2272
|
* pairs, scalars, aliases, comments, directives and recovered errors — in
|
|
@@ -2705,5 +2310,5 @@ export declare class YamlVisitor {
|
|
|
2705
2310
|
*/
|
|
2706
2311
|
static visit(text: string, options?: YamlParseOptions): Stream.Stream<YamlVisitorEvent>;
|
|
2707
2312
|
}
|
|
2708
|
-
export type
|
|
2313
|
+
export { type LineBreaks, LineIndex, type LineIndexOptions, type LintContext, type LintLine, type SourceDiagnostic, type SourceIndex, type SourceLocation, type SourcePosition, type SourceRange, type SourceSpan, type StyleObservation, type YamlAliasEncoded, type YamlBoundCodec, type YamlLintInference, type YamlMapEncoded, type YamlPath, type YamlRangeLike, type YamlRule, type YamlScalarEncoded, type YamlSegment, type YamlSeqEncoded };
|
|
2709
2314
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -8,5 +8,6 @@ import { StyleFloor, StyleVote, YamlLintDiagnostic, YamlLintSeverity } from "./Y
|
|
|
8
8
|
import { YamlToken, YamlTokenKind, YamlTokens } from "./YamlToken.js";
|
|
9
9
|
import { StyleConflict, StyleEvidence, StyleFloorTally, StyleVoteTally, YamlLint, YamlLintConfig, YamlLintRuleSetting, YamlStyleConflictError } from "./YamlLint.js";
|
|
10
10
|
import { YamlVisitor, YamlVisitorEvent } from "./YamlVisitor.js";
|
|
11
|
+
import { LineIndex } from "@effected/source";
|
|
11
12
|
|
|
12
|
-
export { CollectionStyle, QuoteCompat, QuoteStyle, ScalarChomp, ScalarStyle, StyleConflict, StyleEvidence, StyleFloor, StyleFloorTally, StyleVote, StyleVoteTally, Yaml, YamlAlias, YamlComposerErrorCode, YamlDiagnostic, YamlDirective, YamlDocument, YamlEdit, YamlErrorCode, YamlFormat, YamlFormattingOptions, YamlLexErrorCode, YamlLint, YamlLintConfig, YamlLintDiagnostic, YamlLintRuleSetting, YamlLintSeverity, YamlMap, YamlModificationError, YamlModifyErrorCode, YamlNode, YamlPair, YamlParseError, YamlParseErrorCode, YamlParseOptions, YamlRange, YamlScalar, YamlSeq, YamlStringifyError, YamlStringifyErrorCode, YamlStringifyOptions, YamlStyleConflictError, YamlToken, YamlTokenKind, YamlTokens, YamlVisitor, YamlVisitorEvent };
|
|
13
|
+
export { CollectionStyle, LineIndex, QuoteCompat, QuoteStyle, ScalarChomp, ScalarStyle, StyleConflict, StyleEvidence, StyleFloor, StyleFloorTally, StyleVote, StyleVoteTally, Yaml, YamlAlias, YamlComposerErrorCode, YamlDiagnostic, YamlDirective, YamlDocument, YamlEdit, YamlErrorCode, YamlFormat, YamlFormattingOptions, YamlLexErrorCode, YamlLint, YamlLintConfig, YamlLintDiagnostic, YamlLintRuleSetting, YamlLintSeverity, YamlMap, YamlModificationError, YamlModifyErrorCode, YamlNode, YamlPair, YamlParseError, YamlParseErrorCode, YamlParseOptions, YamlRange, YamlScalar, YamlSeq, YamlStringifyError, YamlStringifyErrorCode, YamlStringifyOptions, YamlStyleConflictError, YamlToken, YamlTokenKind, YamlTokens, YamlVisitor, YamlVisitorEvent };
|