@kubb/ast 5.0.0-beta.89 → 5.0.0-beta.91
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.cjs +4 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -72
- package/dist/index.js.map +1 -1
- package/dist/{types-BvAfoVB3.d.ts → types-D12-e8Av.d.ts} +2 -70
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2418,31 +2418,6 @@ type Visitor = {
|
|
|
2418
2418
|
parameter?(node: ParameterNode, context: VisitorContext<ParameterNode>): undefined | null | ParameterNode;
|
|
2419
2419
|
response?(node: ResponseNode, context: VisitorContext<ResponseNode>): undefined | null | ResponseNode;
|
|
2420
2420
|
};
|
|
2421
|
-
/**
|
|
2422
|
-
* A visitor callback result that may be sync or async.
|
|
2423
|
-
*/
|
|
2424
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
2425
|
-
/**
|
|
2426
|
-
* Async visitor for `walk`. Synchronous `Visitor` objects are compatible.
|
|
2427
|
-
*
|
|
2428
|
-
* @example
|
|
2429
|
-
* ```ts
|
|
2430
|
-
* const visitor: AsyncVisitor = {
|
|
2431
|
-
* async operation(node) {
|
|
2432
|
-
* await Promise.resolve(node.operationId)
|
|
2433
|
-
* },
|
|
2434
|
-
* }
|
|
2435
|
-
* ```
|
|
2436
|
-
*/
|
|
2437
|
-
type AsyncVisitor = {
|
|
2438
|
-
input?(node: InputNode, context: VisitorContext<InputNode>): MaybePromise<undefined | null | InputNode>;
|
|
2439
|
-
output?(node: OutputNode, context: VisitorContext<OutputNode>): MaybePromise<undefined | null | OutputNode>;
|
|
2440
|
-
operation?(node: OperationNode, context: VisitorContext<OperationNode>): MaybePromise<undefined | null | OperationNode>;
|
|
2441
|
-
schema?(node: SchemaNode, context: VisitorContext<SchemaNode>): MaybePromise<undefined | null | SchemaNode>;
|
|
2442
|
-
property?(node: PropertyNode, context: VisitorContext<PropertyNode>): MaybePromise<undefined | null | PropertyNode>;
|
|
2443
|
-
parameter?(node: ParameterNode, context: VisitorContext<ParameterNode>): MaybePromise<undefined | null | ParameterNode>;
|
|
2444
|
-
response?(node: ResponseNode, context: VisitorContext<ResponseNode>): MaybePromise<undefined | null | ResponseNode>;
|
|
2445
|
-
};
|
|
2446
2421
|
/**
|
|
2447
2422
|
* Visitor used by `collect`.
|
|
2448
2423
|
*
|
|
@@ -2489,26 +2464,6 @@ type TransformOptions = Visitor & {
|
|
|
2489
2464
|
*/
|
|
2490
2465
|
parent?: Node;
|
|
2491
2466
|
};
|
|
2492
|
-
/**
|
|
2493
|
-
* Options for `walk`.
|
|
2494
|
-
*
|
|
2495
|
-
* @example
|
|
2496
|
-
* ```ts
|
|
2497
|
-
* const options: WalkOptions = { depth: 'deep', concurrency: 10, root: () => {} }
|
|
2498
|
-
* ```
|
|
2499
|
-
*/
|
|
2500
|
-
type WalkOptions = AsyncVisitor & {
|
|
2501
|
-
/**
|
|
2502
|
-
* Traversal depth.
|
|
2503
|
-
* @default 'deep'
|
|
2504
|
-
*/
|
|
2505
|
-
depth?: VisitorDepth;
|
|
2506
|
-
/**
|
|
2507
|
-
* Maximum number of sibling nodes visited concurrently.
|
|
2508
|
-
* @default 30
|
|
2509
|
-
*/
|
|
2510
|
-
concurrency?: number;
|
|
2511
|
-
};
|
|
2512
2467
|
/**
|
|
2513
2468
|
* Options for `collect`.
|
|
2514
2469
|
*
|
|
@@ -2528,29 +2483,6 @@ type CollectOptions<T> = CollectVisitor<T> & {
|
|
|
2528
2483
|
*/
|
|
2529
2484
|
parent?: Node;
|
|
2530
2485
|
};
|
|
2531
|
-
/**
|
|
2532
|
-
* Async depth-first traversal for side effects. Visitor return values are
|
|
2533
|
-
* ignored. Use `transform` when you want to rewrite nodes.
|
|
2534
|
-
*
|
|
2535
|
-
* Sibling nodes at each depth run concurrently up to `options.concurrency`
|
|
2536
|
-
* (defaults to `WALK_CONCURRENCY`). Higher values overlap I/O-bound visitor
|
|
2537
|
-
* work. Lower values reduce memory pressure.
|
|
2538
|
-
*
|
|
2539
|
-
* @example Log every operation
|
|
2540
|
-
* ```ts
|
|
2541
|
-
* await walk(root, {
|
|
2542
|
-
* operation(node) {
|
|
2543
|
-
* console.log(node.operationId)
|
|
2544
|
-
* },
|
|
2545
|
-
* })
|
|
2546
|
-
* ```
|
|
2547
|
-
*
|
|
2548
|
-
* @example Only visit the root node
|
|
2549
|
-
* ```ts
|
|
2550
|
-
* await walk(root, { depth: 'shallow', input: () => {} })
|
|
2551
|
-
* ```
|
|
2552
|
-
*/
|
|
2553
|
-
declare function walk(node: Node, options: WalkOptions): Promise<void>;
|
|
2554
2486
|
/**
|
|
2555
2487
|
* Synchronous depth-first transform. Each visitor callback can return a
|
|
2556
2488
|
* replacement node. Returning `undefined` keeps the original.
|
|
@@ -2865,5 +2797,5 @@ type PrinterBuilder<T extends PrinterFactoryOptions> = (options: T['options']) =
|
|
|
2865
2797
|
*/
|
|
2866
2798
|
declare function createPrinter<T extends PrinterFactoryOptions = PrinterFactoryOptions>(build: PrinterBuilder<T>): (options?: T['options']) => Printer<T>;
|
|
2867
2799
|
//#endregion
|
|
2868
|
-
export {
|
|
2869
|
-
//# sourceMappingURL=types-
|
|
2800
|
+
export { sourceDef as $, NodeDef as $t, StatusCode as A, BreakNode as At, parameterDef as B, constDef as Bt, GenericOperationNode as C, PropertyNode as Ct, createOperation as D, InferSchemaNode as Dt, OperationNode as E, propertyDef as Et, requestBodyDef as F, JsxNode as Ft, UserFileNode as G, createJsx as Gt, FileNode as H, createBreak as Ht, ParameterLocation as I, TextNode as It, createImport as J, functionDef as Jt, createExport as K, createText as Kt, ParameterNode as L, TypeNode as Lt, responseDef as M, ConstNode as Mt, RequestBodyNode as N, FunctionNode as Nt, operationDef as O, ParserOptions as Ot, createRequestBody as P, JSDocNode as Pt, importDef as Q, DistributiveOmit as Qt, ParameterStyle as R, arrowFunctionDef as Rt, inputDef as S, schemaDef as St, HttpOperationNode as T, createProperty as Tt, ImportNode as U, createConst as Ut, ExportNode as V, createArrowFunction as Vt, SourceNode as W, createFunction as Wt, exportDef as X, textDef as Xt, createSource as Y, jsxDef as Yt, fileDef as Z, typeDef as Zt, createOutput as _, StringSchemaNode as _t, Enforce as a, defineDialect as an, DatetimeSchemaNode as at, InputNode as b, UrlSchemaNode as bt, composeMacros as c, NumberSchemaNode as ct, Visitor as d, RefSchemaNode as dt, defineNode as en, ContentNode as et, VisitorContext as f, ScalarSchemaNode as ft, OutputNode as g, SchemaType as gt, Node as h, SchemaNodeByType as ht, createPrinter as i, SchemaDialect as in, DateSchemaNode as it, createResponse as j, CodeNode as jt, ResponseNode as k, ArrowFunctionNode as kt, defineMacro as l, ObjectSchemaNode as lt, transform as m, SchemaNode as mt, PrinterFactoryOptions as n, NodeKind as nn, createContent as nt, Macro as o, schemaTypes as on, EnumSchemaNode as ot, collect as p, ScalarSchemaType as pt, createFile as q, createType as qt, PrinterPartial as r, Dialect as rn, ArraySchemaNode as rt, applyMacros as s, IntersectionSchemaNode as st, Printer as t, BaseNode as tn, contentDef as tt, ParentOf as u, PrimitiveSchemaType as ut, outputDef as v, TimeSchemaNode as vt, HttpMethod as w, UserPropertyNode as wt, createInput as x, createSchema as xt, InputMeta as y, UnionSchemaNode as yt, createParameter as z, breakDef as zt };
|
|
2801
|
+
//# sourceMappingURL=types-D12-e8Av.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as NodeDef, A as StatusCode, At as BreakNode, C as GenericOperationNode, Ct as PropertyNode, Dt as InferSchemaNode, E as OperationNode, Ft as JsxNode, G as UserFileNode, H as FileNode, I as ParameterLocation, It as TextNode, L as ParameterNode, Lt as TypeNode, Mt as ConstNode, N as RequestBodyNode, Nt as FunctionNode, Ot as ParserOptions, Pt as JSDocNode, Qt as DistributiveOmit, R as ParameterStyle, T as HttpOperationNode, U as ImportNode, V as ExportNode, W as SourceNode, _t as StringSchemaNode, a as Enforce, at as DatetimeSchemaNode, b as InputNode, bt as UrlSchemaNode, ct as NumberSchemaNode, d as Visitor, dt as RefSchemaNode, et as ContentNode, f as VisitorContext, ft as ScalarSchemaNode, g as OutputNode, gt as SchemaType, h as Node, ht as SchemaNodeByType, in as SchemaDialect, it as DateSchemaNode, jt as CodeNode, k as ResponseNode, kt as ArrowFunctionNode, lt as ObjectSchemaNode, mt as SchemaNode, n as PrinterFactoryOptions, nn as NodeKind, o as Macro, ot as EnumSchemaNode, pt as ScalarSchemaType, r as PrinterPartial, rn as Dialect, rt as ArraySchemaNode, st as IntersectionSchemaNode, t as Printer, u as ParentOf, ut as PrimitiveSchemaType, vt as TimeSchemaNode, w as HttpMethod, y as InputMeta, yt as UnionSchemaNode } from "./types-D12-e8Av.js";
|
|
2
2
|
export type { ArraySchemaNode, ArrowFunctionNode, BreakNode, CodeNode, ConstNode, ContentNode, DateSchemaNode, DatetimeSchemaNode, Dialect, DistributiveOmit, Enforce, EnumSchemaNode, ExportNode, FileNode, FunctionNode, GenericOperationNode, HttpMethod, HttpOperationNode, ImportNode, InferSchemaNode, InputMeta, InputNode, IntersectionSchemaNode, JSDocNode, JsxNode, Macro, Node, NodeDef, NodeKind, NumberSchemaNode, ObjectSchemaNode, OperationNode, OutputNode, ParameterLocation, ParameterNode, ParameterStyle, ParentOf, ParserOptions, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, RequestBodyNode, ResponseNode, ScalarSchemaNode, ScalarSchemaType, SchemaDialect, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/ast",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.91",
|
|
4
4
|
"description": "Spec-agnostic AST layer for Kubb. Defines the node tree, visitor pattern, factory functions, and type guards used across all code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|