@hey-api/openapi-ts 0.87.2 → 0.87.3
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/clients/fetch/client.ts +34 -1
- package/dist/{config-CQeoZYf_.d.cts → config-BI0uP8YS.d.cts} +952 -6
- package/dist/{config-U5JEpxGS.d.ts → config-BpulPCv9.d.ts} +952 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +325 -325
- package/dist/index.d.ts +325 -325
- package/dist/index.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/openApi--TCWOigv.js +19 -0
- package/dist/openApi--TCWOigv.js.map +1 -0
- package/dist/openApi-hVsWZkpA.cjs +19 -0
- package/dist/openApi-hVsWZkpA.cjs.map +1 -0
- package/dist/run.cjs +1 -1
- package/dist/run.cjs.map +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/src-CF9c-t93.js +11 -0
- package/dist/{src-Ba-zyEiS.js.map → src-CF9c-t93.js.map} +1 -1
- package/dist/src-CVDS5cbw.cjs +19 -0
- package/dist/{src-CNO_U6s-.cjs.map → src-CVDS5cbw.cjs.map} +1 -1
- package/package.json +2 -2
- package/dist/openApi-CT-iM-D8.cjs +0 -19
- package/dist/openApi-CT-iM-D8.cjs.map +0 -1
- package/dist/openApi-HKXoyF4o.js +0 -19
- package/dist/openApi-HKXoyF4o.js.map +0 -1
- package/dist/src-Ba-zyEiS.js +0 -11
- package/dist/src-CNO_U6s-.cjs +0 -19
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IProject, Project, Symbol, SymbolIdentifier, SymbolIn, SymbolMeta } from "@hey-api/codegen-core";
|
|
2
|
+
import * as typescript422 from "typescript";
|
|
2
3
|
import ts from "typescript";
|
|
3
4
|
import { RangeOptions, SemVer } from "semver";
|
|
4
5
|
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpRequest, HttpResponse } from "@angular/common/http";
|
|
@@ -10823,9 +10824,804 @@ declare abstract class TsDsl<T extends ts.Node = ts.Node> implements ITsDsl<T> {
|
|
|
10823
10824
|
type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<I>> | undefined : NodeOf<I>;
|
|
10824
10825
|
type NodeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<U extends TsDsl<infer N> ? N : U> : I extends string ? ts.Expression : I extends boolean ? ts.Expression : I extends TsDsl<infer N> ? N : I extends ts.Node ? I : never;
|
|
10825
10826
|
type MaybeTsDsl<T> = string extends T ? Exclude<T, string> extends ts.Node ? string | Exclude<T, string> | TsDsl<Exclude<T, string>> : string : T extends TsDsl<any> ? T : T extends ts.Node ? T | TsDsl<T> : never;
|
|
10827
|
+
type TypeOfTsDsl<T> = T extends TsDsl<infer U> ? U : never;
|
|
10828
|
+
declare abstract class TypeTsDsl<T extends ts.TypeNode | ts.TypeElement | ts.LiteralTypeNode | ts.TypeParameterDeclaration = ts.TypeNode> extends TsDsl<T> {}
|
|
10826
10829
|
type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<I>> | undefined : TypeOf<I>;
|
|
10827
10830
|
type TypeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<TypeOf<U>> : I extends string ? ts.TypeNode : I extends boolean ? ts.LiteralTypeNode : I extends TsDsl<infer N> ? N : I extends ts.TypeNode ? I : never;
|
|
10828
10831
|
//#endregion
|
|
10832
|
+
//#region src/ts-dsl/array.d.ts
|
|
10833
|
+
declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
|
|
10834
|
+
private _elements;
|
|
10835
|
+
/** Adds one or more elements to the array expression. */
|
|
10836
|
+
elements(...exprs: ReadonlyArray<string | number | boolean | TsDsl<ts.Expression>>): this;
|
|
10837
|
+
$render(): ts.ArrayLiteralExpression;
|
|
10838
|
+
}
|
|
10839
|
+
//#endregion
|
|
10840
|
+
//#region src/ts-dsl/await.d.ts
|
|
10841
|
+
declare class AwaitTsDsl extends TsDsl<ts.AwaitExpression> {
|
|
10842
|
+
private _awaitExpr;
|
|
10843
|
+
constructor(expr: MaybeTsDsl<WithString>);
|
|
10844
|
+
$render(): ts.AwaitExpression;
|
|
10845
|
+
}
|
|
10846
|
+
interface AwaitTsDsl extends AccessMixin {}
|
|
10847
|
+
//#endregion
|
|
10848
|
+
//#region src/ts-dsl/mixins/args.d.ts
|
|
10849
|
+
/**
|
|
10850
|
+
* Adds `.arg()` and `.args()` for managing expression arguments in call-like nodes.
|
|
10851
|
+
*/
|
|
10852
|
+
declare class ArgsMixin extends TsDsl {
|
|
10853
|
+
private _args?;
|
|
10854
|
+
/** Adds a single expression argument. */
|
|
10855
|
+
arg(arg: MaybeTsDsl<WithString>): this;
|
|
10856
|
+
/** Adds one or more expression arguments. */
|
|
10857
|
+
args(...args: ReadonlyArray<MaybeTsDsl<WithString>>): this;
|
|
10858
|
+
/** Renders the arguments into an array of `Expression`s. */
|
|
10859
|
+
protected $args(): ReadonlyArray<ts.Expression>;
|
|
10860
|
+
$render(): ts.Node;
|
|
10861
|
+
}
|
|
10862
|
+
//#endregion
|
|
10863
|
+
//#region src/ts-dsl/mixins/type-args.d.ts
|
|
10864
|
+
declare class TypeArgsMixin extends TsDsl {
|
|
10865
|
+
protected _generics?: Array<WithString<MaybeTsDsl<TypeOfTsDsl<TypeTsDsl>>>>;
|
|
10866
|
+
/** Adds a single type argument (e.g. `string` in `Foo<string>`). */
|
|
10867
|
+
generic(arg: WithString<MaybeTsDsl<TypeOfTsDsl<TypeTsDsl>>>): this;
|
|
10868
|
+
/** Adds type arguments (e.g. `Map<string, number>`). */
|
|
10869
|
+
generics(...args: ReadonlyArray<WithString<MaybeTsDsl<TypeOfTsDsl<TypeTsDsl>>>>): this;
|
|
10870
|
+
/**
|
|
10871
|
+
* Returns the type arguments as an array of ts.TypeNode nodes.
|
|
10872
|
+
*/
|
|
10873
|
+
protected $generics(): ReadonlyArray<ts.TypeNode> | undefined;
|
|
10874
|
+
$render(): ts.Node;
|
|
10875
|
+
}
|
|
10876
|
+
//#endregion
|
|
10877
|
+
//#region src/ts-dsl/call.d.ts
|
|
10878
|
+
declare class CallTsDsl extends TsDsl<ts.CallExpression> {
|
|
10879
|
+
private _callee;
|
|
10880
|
+
constructor(callee: MaybeTsDsl<WithString>, ...args: ReadonlyArray<MaybeTsDsl<WithString> | undefined>);
|
|
10881
|
+
$render(): ts.CallExpression;
|
|
10882
|
+
}
|
|
10883
|
+
interface CallTsDsl extends AccessMixin, ArgsMixin, TypeArgsMixin {}
|
|
10884
|
+
//#endregion
|
|
10885
|
+
//#region src/ts-dsl/return.d.ts
|
|
10886
|
+
declare class ReturnTsDsl extends TsDsl<ts.ReturnStatement> {
|
|
10887
|
+
private _returnExpr?;
|
|
10888
|
+
constructor(expr?: MaybeTsDsl<WithString>);
|
|
10889
|
+
$render(): ts.ReturnStatement;
|
|
10890
|
+
}
|
|
10891
|
+
interface ReturnTsDsl extends AccessMixin {}
|
|
10892
|
+
//#endregion
|
|
10893
|
+
//#region src/ts-dsl/mixins/access.d.ts
|
|
10894
|
+
declare class AccessMixin {
|
|
10895
|
+
/** Accesses a property on the current expression (e.g. `this.foo`). */
|
|
10896
|
+
attr(this: MaybeTsDsl<WithString>, name: WithString<ts.MemberName> | number): AttrTsDsl;
|
|
10897
|
+
/** Awaits the current expression (e.g. `await expr`). */
|
|
10898
|
+
await(this: MaybeTsDsl<WithString>): AwaitTsDsl;
|
|
10899
|
+
/** Calls the current expression (e.g. `fn(arg1, arg2)`). */
|
|
10900
|
+
call(this: MaybeTsDsl<WithString>, ...args: ReadonlyArray<MaybeTsDsl<WithString> | undefined>): CallTsDsl;
|
|
10901
|
+
/** Produces a `return` statement returning the current expression. */
|
|
10902
|
+
return(this: MaybeTsDsl<WithString>): ReturnTsDsl;
|
|
10903
|
+
}
|
|
10904
|
+
//#endregion
|
|
10905
|
+
//#region src/ts-dsl/binary.d.ts
|
|
10906
|
+
type Operator = '!=' | '!==' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '===' | '>' | '>=' | '??' | '||';
|
|
10907
|
+
declare class BinaryTsDsl extends TsDsl<ts.BinaryExpression> {
|
|
10908
|
+
private left;
|
|
10909
|
+
private operator;
|
|
10910
|
+
private right;
|
|
10911
|
+
constructor(left: MaybeTsDsl<WithString>, operator: Operator | ts.BinaryOperator, right: MaybeTsDsl<WithString>);
|
|
10912
|
+
$render(): ts.BinaryExpression;
|
|
10913
|
+
private mapOperator;
|
|
10914
|
+
}
|
|
10915
|
+
//#endregion
|
|
10916
|
+
//#region src/ts-dsl/mixins/assignment.d.ts
|
|
10917
|
+
declare class AssignmentMixin {
|
|
10918
|
+
/** Creates an assignment expression (e.g. `this = expr`). */
|
|
10919
|
+
assign(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10920
|
+
}
|
|
10921
|
+
//#endregion
|
|
10922
|
+
//#region src/ts-dsl/mixins/operator.d.ts
|
|
10923
|
+
declare class OperatorMixin {
|
|
10924
|
+
/** Logical AND — `this && expr` */
|
|
10925
|
+
and(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10926
|
+
/** Nullish coalescing — `this ?? expr` */
|
|
10927
|
+
coalesce(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10928
|
+
/** Division — `this / expr` */
|
|
10929
|
+
div(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10930
|
+
/** Strict equality — `this === expr` */
|
|
10931
|
+
eq(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10932
|
+
/** Greater than — `this > expr` */
|
|
10933
|
+
gt(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10934
|
+
/** Greater than or equal — `this >= expr` */
|
|
10935
|
+
gte(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10936
|
+
/** Loose equality — `this == expr` */
|
|
10937
|
+
looseEq(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10938
|
+
/** Loose inequality — `this != expr` */
|
|
10939
|
+
looseNeq(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10940
|
+
/** Less than — `this < expr` */
|
|
10941
|
+
lt(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10942
|
+
/** Less than or equal — `this <= expr` */
|
|
10943
|
+
lte(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10944
|
+
/** Subtraction — `this - expr` */
|
|
10945
|
+
minus(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10946
|
+
/** Strict inequality — `this !== expr` */
|
|
10947
|
+
neq(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10948
|
+
/** Logical OR — `this || expr` */
|
|
10949
|
+
or(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10950
|
+
/** Addition — `this + expr` */
|
|
10951
|
+
plus(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10952
|
+
/** Multiplication — `this * expr` */
|
|
10953
|
+
times(this: MaybeTsDsl<WithString>, expr: MaybeTsDsl<WithString>): BinaryTsDsl;
|
|
10954
|
+
}
|
|
10955
|
+
//#endregion
|
|
10956
|
+
//#region src/ts-dsl/mixins/optional.d.ts
|
|
10957
|
+
declare class OptionalMixin {
|
|
10958
|
+
protected isOptional?: boolean;
|
|
10959
|
+
protected questionToken?: ts.PunctuationToken<ts.SyntaxKind.QuestionToken>;
|
|
10960
|
+
optional<T extends this>(this: T, condition?: boolean): T;
|
|
10961
|
+
}
|
|
10962
|
+
//#endregion
|
|
10963
|
+
//#region src/ts-dsl/attr.d.ts
|
|
10964
|
+
declare class AttrTsDsl extends TsDsl<ts.PropertyAccessExpression | ts.ElementAccessExpression> {
|
|
10965
|
+
private left;
|
|
10966
|
+
private right;
|
|
10967
|
+
constructor(left: MaybeTsDsl<WithString>, right: WithString<ts.MemberName> | number);
|
|
10968
|
+
$render(): ts.PropertyAccessExpression | ts.ElementAccessExpression;
|
|
10969
|
+
}
|
|
10970
|
+
interface AttrTsDsl extends AccessMixin, AssignmentMixin, OperatorMixin, OptionalMixin {}
|
|
10971
|
+
//#endregion
|
|
10972
|
+
//#region src/ts-dsl/mixins/decorator.d.ts
|
|
10973
|
+
declare class DecoratorMixin extends TsDsl {
|
|
10974
|
+
private decorators?;
|
|
10975
|
+
/** Adds a decorator (e.g. `@sealed({ in: 'root' })`). */
|
|
10976
|
+
decorator(name: WithString, ...args: ReadonlyArray<MaybeTsDsl<WithString>>): this;
|
|
10977
|
+
/** Renders the decorators into an array of `ts.Decorator`s. */
|
|
10978
|
+
protected $decorators(): ReadonlyArray<ts.Decorator>;
|
|
10979
|
+
$render(): ts.Node;
|
|
10980
|
+
}
|
|
10981
|
+
//#endregion
|
|
10982
|
+
//#region src/ts-dsl/describe.d.ts
|
|
10983
|
+
declare class DescribeTsDsl extends TsDsl {
|
|
10984
|
+
private _lines;
|
|
10985
|
+
constructor(lines?: MaybeArray$1<string>, fn?: (d: DescribeTsDsl) => void);
|
|
10986
|
+
add(...lines: ReadonlyArray<string>): this;
|
|
10987
|
+
apply<T extends ts.Node>(node: T): T;
|
|
10988
|
+
$render(): ts.Node;
|
|
10989
|
+
}
|
|
10990
|
+
//#endregion
|
|
10991
|
+
//#region src/ts-dsl/mixins/describe.d.ts
|
|
10992
|
+
declare function DescribeMixin<TBase extends new (...args: ReadonlyArray<any>) => ITsDsl>(Base: TBase): {
|
|
10993
|
+
new (...args: ReadonlyArray<any>): {
|
|
10994
|
+
_desc?: DescribeTsDsl;
|
|
10995
|
+
describe(lines?: MaybeArray$1<string>, fn?: (d: DescribeTsDsl) => void): /*elided*/any;
|
|
10996
|
+
$render(): typescript422.Node;
|
|
10997
|
+
};
|
|
10998
|
+
} & TBase;
|
|
10999
|
+
type DescribeMixin = InstanceType<ReturnType<typeof DescribeMixin>>;
|
|
11000
|
+
//#endregion
|
|
11001
|
+
//#region src/ts-dsl/mixins/modifiers.d.ts
|
|
11002
|
+
type Target = object & {
|
|
11003
|
+
_m?(kind: ts.ModifierSyntaxKind, condition?: boolean): unknown;
|
|
11004
|
+
};
|
|
11005
|
+
/**
|
|
11006
|
+
* Mixin that adds an `abstract` modifier to a node.
|
|
11007
|
+
*/
|
|
11008
|
+
declare class AbstractMixin {
|
|
11009
|
+
/**
|
|
11010
|
+
* Adds the `abstract` keyword modifier if the condition is true.
|
|
11011
|
+
*
|
|
11012
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11013
|
+
* @returns The target object for chaining.
|
|
11014
|
+
*/
|
|
11015
|
+
abstract<T extends Target>(this: T, condition?: boolean): T;
|
|
11016
|
+
}
|
|
11017
|
+
/**
|
|
11018
|
+
* Mixin that adds an `async` modifier to a node.
|
|
11019
|
+
*/
|
|
11020
|
+
declare class AsyncMixin {
|
|
11021
|
+
/**
|
|
11022
|
+
* Adds the `async` keyword modifier if the condition is true.
|
|
11023
|
+
*
|
|
11024
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11025
|
+
* @returns The target object for chaining.
|
|
11026
|
+
*/
|
|
11027
|
+
async<T extends Target>(this: T, condition?: boolean): T;
|
|
11028
|
+
}
|
|
11029
|
+
/**
|
|
11030
|
+
* Mixin that adds a `default` modifier to a node.
|
|
11031
|
+
*/
|
|
11032
|
+
declare class DefaultMixin {
|
|
11033
|
+
/**
|
|
11034
|
+
* Adds the `default` keyword modifier if the condition is true.
|
|
11035
|
+
*
|
|
11036
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11037
|
+
* @returns The target object for chaining.
|
|
11038
|
+
*/
|
|
11039
|
+
default<T extends Target>(this: T, condition?: boolean): T;
|
|
11040
|
+
}
|
|
11041
|
+
/**
|
|
11042
|
+
* Mixin that adds an `export` modifier to a node.
|
|
11043
|
+
*/
|
|
11044
|
+
declare class ExportMixin {
|
|
11045
|
+
/**
|
|
11046
|
+
* Adds the `export` keyword modifier if the condition is true.
|
|
11047
|
+
*
|
|
11048
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11049
|
+
* @returns The target object for chaining.
|
|
11050
|
+
*/
|
|
11051
|
+
export<T extends Target>(this: T, condition?: boolean): T;
|
|
11052
|
+
}
|
|
11053
|
+
/**
|
|
11054
|
+
* Mixin that adds a `private` modifier to a node.
|
|
11055
|
+
*/
|
|
11056
|
+
declare class PrivateMixin {
|
|
11057
|
+
/**
|
|
11058
|
+
* Adds the `private` keyword modifier if the condition is true.
|
|
11059
|
+
*
|
|
11060
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11061
|
+
* @returns The target object for chaining.
|
|
11062
|
+
*/
|
|
11063
|
+
private<T extends Target>(this: T, condition?: boolean): T;
|
|
11064
|
+
}
|
|
11065
|
+
/**
|
|
11066
|
+
* Mixin that adds a `protected` modifier to a node.
|
|
11067
|
+
*/
|
|
11068
|
+
declare class ProtectedMixin {
|
|
11069
|
+
/**
|
|
11070
|
+
* Adds the `protected` keyword modifier if the condition is true.
|
|
11071
|
+
*
|
|
11072
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11073
|
+
* @returns The target object for chaining.
|
|
11074
|
+
*/
|
|
11075
|
+
protected<T extends Target>(this: T, condition?: boolean): T;
|
|
11076
|
+
}
|
|
11077
|
+
/**
|
|
11078
|
+
* Mixin that adds a `public` modifier to a node.
|
|
11079
|
+
*/
|
|
11080
|
+
declare class PublicMixin {
|
|
11081
|
+
/**
|
|
11082
|
+
* Adds the `public` keyword modifier if the condition is true.
|
|
11083
|
+
*
|
|
11084
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11085
|
+
* @returns The target object for chaining.
|
|
11086
|
+
*/
|
|
11087
|
+
public<T extends Target>(this: T, condition?: boolean): T;
|
|
11088
|
+
}
|
|
11089
|
+
/**
|
|
11090
|
+
* Mixin that adds a `readonly` modifier to a node.
|
|
11091
|
+
*/
|
|
11092
|
+
declare class ReadonlyMixin {
|
|
11093
|
+
/**
|
|
11094
|
+
* Adds the `readonly` keyword modifier if the condition is true.
|
|
11095
|
+
*
|
|
11096
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11097
|
+
* @returns The target object for chaining.
|
|
11098
|
+
*/
|
|
11099
|
+
readonly<T extends Target>(this: T, condition?: boolean): T;
|
|
11100
|
+
}
|
|
11101
|
+
/**
|
|
11102
|
+
* Mixin that adds a `static` modifier to a node.
|
|
11103
|
+
*/
|
|
11104
|
+
declare class StaticMixin {
|
|
11105
|
+
/**
|
|
11106
|
+
* Adds the `static` keyword modifier if the condition is true.
|
|
11107
|
+
*
|
|
11108
|
+
* @param condition - Whether to add the modifier (default: true).
|
|
11109
|
+
* @returns The target object for chaining.
|
|
11110
|
+
*/
|
|
11111
|
+
static<T extends Target>(this: T, condition?: boolean): T;
|
|
11112
|
+
}
|
|
11113
|
+
//#endregion
|
|
11114
|
+
//#region src/ts-dsl/mixins/value.d.ts
|
|
11115
|
+
declare class ValueMixin extends TsDsl {
|
|
11116
|
+
private value?;
|
|
11117
|
+
/** Sets the initializer expression (e.g. `= expr`). */
|
|
11118
|
+
assign<T extends this>(this: T, expr: MaybeTsDsl<WithString>): T;
|
|
11119
|
+
protected $value(): ts.Expression | undefined;
|
|
11120
|
+
$render(): ts.Node;
|
|
11121
|
+
}
|
|
11122
|
+
//#endregion
|
|
11123
|
+
//#region src/ts-dsl/field.d.ts
|
|
11124
|
+
declare class FieldTsDsl extends TsDsl<ts.PropertyDeclaration> {
|
|
11125
|
+
private modifiers;
|
|
11126
|
+
private name;
|
|
11127
|
+
private _type?;
|
|
11128
|
+
constructor(name: string, fn?: (f: FieldTsDsl) => void);
|
|
11129
|
+
/** Sets the field type. */
|
|
11130
|
+
type(type: string | TypeTsDsl): this;
|
|
11131
|
+
/** Builds the `PropertyDeclaration` node. */
|
|
11132
|
+
$render(): ts.PropertyDeclaration;
|
|
11133
|
+
}
|
|
11134
|
+
interface FieldTsDsl extends DecoratorMixin, DescribeMixin, PrivateMixin, ProtectedMixin, PublicMixin, ReadonlyMixin, StaticMixin, ValueMixin {}
|
|
11135
|
+
//#endregion
|
|
11136
|
+
//#region src/ts-dsl/mixins/do.d.ts
|
|
11137
|
+
/**
|
|
11138
|
+
* Adds `.do()` for appending statements or expressions to a body.
|
|
11139
|
+
*/
|
|
11140
|
+
declare class DoMixin extends TsDsl {
|
|
11141
|
+
private _do?;
|
|
11142
|
+
/** Adds one or more expressions/statements to the body. */
|
|
11143
|
+
do(...items: ReadonlyArray<MaybeTsDsl<WithStatement>>): this;
|
|
11144
|
+
/** Renders the collected `.do()` calls into an array of `Statement` nodes. */
|
|
11145
|
+
protected $do(): ReadonlyArray<ts.Statement>;
|
|
11146
|
+
$render(): ts.Node;
|
|
11147
|
+
}
|
|
11148
|
+
//#endregion
|
|
11149
|
+
//#region src/ts-dsl/mixins/pattern.d.ts
|
|
11150
|
+
/**
|
|
11151
|
+
* Mixin providing `.array()`, `.object()`, and `.spread()` methods for defining destructuring patterns.
|
|
11152
|
+
*/
|
|
11153
|
+
declare class PatternMixin extends TsDsl {
|
|
11154
|
+
private pattern?;
|
|
11155
|
+
/** Defines an array binding pattern. */
|
|
11156
|
+
array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
|
|
11157
|
+
/** Defines an object binding pattern. */
|
|
11158
|
+
object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
|
|
11159
|
+
/** Adds a spread element (e.g. `...args`, `...options`) to the pattern. */
|
|
11160
|
+
spread(name: string): this;
|
|
11161
|
+
/** Renders the pattern into a `BindingName`. */
|
|
11162
|
+
protected $pattern(): ts.BindingName | undefined;
|
|
11163
|
+
$render(): ts.Node;
|
|
11164
|
+
}
|
|
11165
|
+
//#endregion
|
|
11166
|
+
//#region src/ts-dsl/param.d.ts
|
|
11167
|
+
declare class ParamTsDsl extends TsDsl<ts.ParameterDeclaration> {
|
|
11168
|
+
private name?;
|
|
11169
|
+
private _type?;
|
|
11170
|
+
constructor(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
|
|
11171
|
+
/** Sets the parameter type. */
|
|
11172
|
+
type(type: string | TypeTsDsl): this;
|
|
11173
|
+
$render(): ts.ParameterDeclaration;
|
|
11174
|
+
}
|
|
11175
|
+
interface ParamTsDsl extends DecoratorMixin, OptionalMixin, PatternMixin, ValueMixin {}
|
|
11176
|
+
//#endregion
|
|
11177
|
+
//#region src/ts-dsl/mixins/param.d.ts
|
|
11178
|
+
declare class ParamMixin extends TsDsl {
|
|
11179
|
+
private _params?;
|
|
11180
|
+
/** Adds a parameter. */
|
|
11181
|
+
param(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void): this;
|
|
11182
|
+
/** Adds multiple parameters. */
|
|
11183
|
+
params(...params: ReadonlyArray<MaybeTsDsl<ts.ParameterDeclaration>>): this;
|
|
11184
|
+
/** Renders the parameters into an array of `ParameterDeclaration`s. */
|
|
11185
|
+
protected $params(): ReadonlyArray<ts.ParameterDeclaration>;
|
|
11186
|
+
$render(): ts.Node;
|
|
11187
|
+
}
|
|
11188
|
+
//#endregion
|
|
11189
|
+
//#region src/ts-dsl/init.d.ts
|
|
11190
|
+
declare class InitTsDsl extends TsDsl<ts.ConstructorDeclaration> {
|
|
11191
|
+
private modifiers;
|
|
11192
|
+
constructor(fn?: (i: InitTsDsl) => void);
|
|
11193
|
+
/** Builds the `ConstructorDeclaration` node. */
|
|
11194
|
+
$render(): ts.ConstructorDeclaration;
|
|
11195
|
+
}
|
|
11196
|
+
interface InitTsDsl extends DecoratorMixin, DescribeMixin, DoMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin {}
|
|
11197
|
+
//#endregion
|
|
11198
|
+
//#region src/ts-dsl/type/param.d.ts
|
|
11199
|
+
declare class TypeParamTsDsl extends TypeTsDsl<ts.TypeParameterDeclaration> {
|
|
11200
|
+
protected name?: WithString<ts.Identifier>;
|
|
11201
|
+
protected constraint?: WithString<MaybeTsDsl<TypeTsDsl>> | boolean;
|
|
11202
|
+
protected defaultValue?: WithString<MaybeTsDsl<TypeTsDsl>> | boolean;
|
|
11203
|
+
constructor(name?: WithString<ts.Identifier>, fn?: (name: TypeParamTsDsl) => void);
|
|
11204
|
+
default(value: WithString<MaybeTsDsl<TypeTsDsl>> | boolean): this;
|
|
11205
|
+
extends(constraint: WithString<MaybeTsDsl<TypeTsDsl>> | boolean): this;
|
|
11206
|
+
$render(): ts.TypeParameterDeclaration;
|
|
11207
|
+
}
|
|
11208
|
+
//#endregion
|
|
11209
|
+
//#region src/ts-dsl/mixins/type-params.d.ts
|
|
11210
|
+
declare class TypeParamsMixin extends TsDsl {
|
|
11211
|
+
protected _generics?: Array<string | MaybeTsDsl<TypeOfTsDsl<TypeParamTsDsl>>>;
|
|
11212
|
+
/** Adds a single type parameter (e.g. `T` in `Array<T>`). */
|
|
11213
|
+
generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this;
|
|
11214
|
+
/** Adds type parameters (e.g. `Map<string, T>`). */
|
|
11215
|
+
generics(...args: ReadonlyArray<string | MaybeTsDsl<TypeOfTsDsl<TypeParamTsDsl>>>): this;
|
|
11216
|
+
/**
|
|
11217
|
+
* Returns the type parameters as an array of ts.TypeParameterDeclaration nodes.
|
|
11218
|
+
*/
|
|
11219
|
+
protected $generics(): ReadonlyArray<ts.TypeParameterDeclaration> | undefined;
|
|
11220
|
+
$render(): ts.Node;
|
|
11221
|
+
}
|
|
11222
|
+
//#endregion
|
|
11223
|
+
//#region src/ts-dsl/method.d.ts
|
|
11224
|
+
declare class MethodTsDsl extends TsDsl<ts.MethodDeclaration> {
|
|
11225
|
+
private modifiers;
|
|
11226
|
+
private name;
|
|
11227
|
+
private _returns?;
|
|
11228
|
+
constructor(name: string, fn?: (m: MethodTsDsl) => void);
|
|
11229
|
+
/** Sets the return type. */
|
|
11230
|
+
returns(type: string | TypeTsDsl): this;
|
|
11231
|
+
/** Builds the `MethodDeclaration` node. */
|
|
11232
|
+
$render(): ts.MethodDeclaration;
|
|
11233
|
+
}
|
|
11234
|
+
interface MethodTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DescribeMixin, DoMixin, OptionalMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
|
|
11235
|
+
//#endregion
|
|
11236
|
+
//#region src/ts-dsl/class.d.ts
|
|
11237
|
+
declare class ClassTsDsl extends TsDsl<ts.ClassDeclaration> {
|
|
11238
|
+
private heritageClauses;
|
|
11239
|
+
private body;
|
|
11240
|
+
private modifiers;
|
|
11241
|
+
private name;
|
|
11242
|
+
constructor(name: string);
|
|
11243
|
+
/** Adds one or more class members (fields, methods, etc.). */
|
|
11244
|
+
do(...items: ReadonlyArray<MaybeTsDsl<ts.ClassElement | ts.Node>>): this;
|
|
11245
|
+
/** Adds a base class to extend from. */
|
|
11246
|
+
extends(base?: WithString | false | null): this;
|
|
11247
|
+
/** Adds a class field. */
|
|
11248
|
+
field(name: string, fn?: (f: FieldTsDsl) => void): this;
|
|
11249
|
+
/** Adds a class constructor. */
|
|
11250
|
+
init(fn?: (i: InitTsDsl) => void): this;
|
|
11251
|
+
/** Adds a class method. */
|
|
11252
|
+
method(name: string, fn?: (m: MethodTsDsl) => void): this;
|
|
11253
|
+
/** Inserts an empty line between members for formatting. */
|
|
11254
|
+
newline(): this;
|
|
11255
|
+
/** Builds the `ClassDeclaration` node. */
|
|
11256
|
+
$render(): ts.ClassDeclaration;
|
|
11257
|
+
}
|
|
11258
|
+
interface ClassTsDsl extends AbstractMixin, DecoratorMixin, DescribeMixin, DefaultMixin, ExportMixin, TypeParamsMixin {}
|
|
11259
|
+
//#endregion
|
|
11260
|
+
//#region src/ts-dsl/decorator.d.ts
|
|
11261
|
+
declare class DecoratorTsDsl extends TsDsl<ts.Decorator> {
|
|
11262
|
+
private name;
|
|
11263
|
+
constructor(name: WithString, ...args: ReadonlyArray<MaybeTsDsl<WithString>>);
|
|
11264
|
+
$render(): ts.Decorator;
|
|
11265
|
+
}
|
|
11266
|
+
interface DecoratorTsDsl extends ArgsMixin {}
|
|
11267
|
+
//#endregion
|
|
11268
|
+
//#region src/ts-dsl/type/attr.d.ts
|
|
11269
|
+
declare class TypeAttrTsDsl extends TsDsl<ts.QualifiedName> {
|
|
11270
|
+
private _base?;
|
|
11271
|
+
private right;
|
|
11272
|
+
constructor(base: WithString<MaybeTsDsl<ts.EntityName>>, right: WithString<ts.Identifier>);
|
|
11273
|
+
constructor(right: WithString<ts.Identifier>);
|
|
11274
|
+
base(base?: WithString<MaybeTsDsl<ts.EntityName>>): this;
|
|
11275
|
+
$render(): ts.QualifiedName;
|
|
11276
|
+
}
|
|
11277
|
+
//#endregion
|
|
11278
|
+
//#region src/ts-dsl/type/expr.d.ts
|
|
11279
|
+
declare class TypeExprTsDsl extends TypeTsDsl<ts.TypeReferenceNode> {
|
|
11280
|
+
private _exprInput?;
|
|
11281
|
+
constructor();
|
|
11282
|
+
constructor(fn: (t: TypeExprTsDsl) => void);
|
|
11283
|
+
constructor(name: string);
|
|
11284
|
+
constructor(name: string, fn?: (t: TypeExprTsDsl) => void);
|
|
11285
|
+
/** Accesses a nested type (e.g. `Foo.Bar`). */
|
|
11286
|
+
attr(right: WithString<ts.Identifier> | TypeAttrTsDsl): this;
|
|
11287
|
+
$render(): ts.TypeReferenceNode;
|
|
11288
|
+
}
|
|
11289
|
+
interface TypeExprTsDsl extends TypeArgsMixin {}
|
|
11290
|
+
//#endregion
|
|
11291
|
+
//#region src/ts-dsl/type/query.d.ts
|
|
11292
|
+
declare class TypeQueryTsDsl extends TypeTsDsl<ts.TypeQueryNode> {
|
|
11293
|
+
private expr;
|
|
11294
|
+
constructor(expr: string | MaybeTsDsl<TsDsl>);
|
|
11295
|
+
$render(): ts.TypeQueryNode;
|
|
11296
|
+
}
|
|
11297
|
+
//#endregion
|
|
11298
|
+
//#region src/ts-dsl/expr.d.ts
|
|
11299
|
+
declare class ExprTsDsl extends TsDsl<ts.Expression> {
|
|
11300
|
+
private _exprInput;
|
|
11301
|
+
constructor(id: MaybeTsDsl<WithString>);
|
|
11302
|
+
typeof(): TypeQueryTsDsl;
|
|
11303
|
+
returnType(): TypeExprTsDsl;
|
|
11304
|
+
$render(): ts.Expression;
|
|
11305
|
+
}
|
|
11306
|
+
interface ExprTsDsl extends AccessMixin, OperatorMixin {}
|
|
11307
|
+
//#endregion
|
|
11308
|
+
//#region src/ts-dsl/func.d.ts
|
|
11309
|
+
type FuncMode = 'arrow' | 'decl' | 'expr';
|
|
11310
|
+
declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends TsDsl<M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction> {
|
|
11311
|
+
private mode;
|
|
11312
|
+
private modifiers;
|
|
11313
|
+
private name?;
|
|
11314
|
+
private _returns?;
|
|
11315
|
+
constructor();
|
|
11316
|
+
constructor(fn: (f: ImplFuncTsDsl<'arrow'>) => void);
|
|
11317
|
+
constructor(name: string);
|
|
11318
|
+
constructor(name: string, fn: (f: ImplFuncTsDsl<'decl'>) => void);
|
|
11319
|
+
arrow(): FuncTsDsl<'arrow'>;
|
|
11320
|
+
decl(): FuncTsDsl<'decl'>;
|
|
11321
|
+
expr(): FuncTsDsl<'expr'>;
|
|
11322
|
+
/** Sets the return type. */
|
|
11323
|
+
returns(type: string | TypeTsDsl): this;
|
|
11324
|
+
$render(): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
|
|
11325
|
+
}
|
|
11326
|
+
interface ImplFuncTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DescribeMixin, DoMixin, OptionalMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
|
|
11327
|
+
declare const FuncTsDsl: {
|
|
11328
|
+
new (): FuncTsDsl<"arrow">;
|
|
11329
|
+
new (fn: (f: FuncTsDsl<"arrow">) => void): FuncTsDsl<"arrow">;
|
|
11330
|
+
new (name: string): FuncTsDsl<"decl">;
|
|
11331
|
+
new (name: string, fn: (f: FuncTsDsl<"decl">) => void): FuncTsDsl<"decl">;
|
|
11332
|
+
} & typeof ImplFuncTsDsl;
|
|
11333
|
+
type FuncTsDsl<M extends FuncMode = 'arrow'> = ImplFuncTsDsl<M>;
|
|
11334
|
+
//#endregion
|
|
11335
|
+
//#region src/ts-dsl/getter.d.ts
|
|
11336
|
+
declare class GetterTsDsl extends TsDsl<ts.GetAccessorDeclaration> {
|
|
11337
|
+
private modifiers;
|
|
11338
|
+
private name;
|
|
11339
|
+
constructor(name: string, fn?: (g: GetterTsDsl) => void);
|
|
11340
|
+
$render(): ts.GetAccessorDeclaration;
|
|
11341
|
+
}
|
|
11342
|
+
interface GetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DescribeMixin, DoMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
|
|
11343
|
+
//#endregion
|
|
11344
|
+
//#region src/ts-dsl/if.d.ts
|
|
11345
|
+
declare class IfTsDsl extends TsDsl<ts.IfStatement> {
|
|
11346
|
+
private conditionInput?;
|
|
11347
|
+
private elseInput?;
|
|
11348
|
+
constructor(condition?: MaybeTsDsl<WithString>);
|
|
11349
|
+
condition(condition: MaybeTsDsl<WithString>): this;
|
|
11350
|
+
otherwise(...statements: ReadonlyArray<MaybeTsDsl<ts.Statement>>): this;
|
|
11351
|
+
$render(): ts.IfStatement;
|
|
11352
|
+
}
|
|
11353
|
+
interface IfTsDsl extends DoMixin {}
|
|
11354
|
+
//#endregion
|
|
11355
|
+
//#region src/ts-dsl/literal.d.ts
|
|
11356
|
+
declare class LiteralTsDsl extends TsDsl<ts.LiteralTypeNode['literal']> {
|
|
11357
|
+
private value;
|
|
11358
|
+
constructor(value: string | number | boolean);
|
|
11359
|
+
$render(): ts.LiteralTypeNode['literal'];
|
|
11360
|
+
}
|
|
11361
|
+
//#endregion
|
|
11362
|
+
//#region src/ts-dsl/new.d.ts
|
|
11363
|
+
declare class NewTsDsl extends TsDsl<ts.NewExpression> {
|
|
11364
|
+
private classExpr;
|
|
11365
|
+
constructor(classExpr: MaybeTsDsl<WithString>, ...args: ReadonlyArray<MaybeTsDsl<WithString>>);
|
|
11366
|
+
/** Builds the `NewExpression` node. */
|
|
11367
|
+
$render(): ts.NewExpression;
|
|
11368
|
+
}
|
|
11369
|
+
interface NewTsDsl extends AccessMixin, ArgsMixin, TypeArgsMixin {}
|
|
11370
|
+
//#endregion
|
|
11371
|
+
//#region src/ts-dsl/newline.d.ts
|
|
11372
|
+
declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
|
|
11373
|
+
$render(): ts.Identifier;
|
|
11374
|
+
}
|
|
11375
|
+
//#endregion
|
|
11376
|
+
//#region src/ts-dsl/not.d.ts
|
|
11377
|
+
declare class NotTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
|
|
11378
|
+
private _notExpr;
|
|
11379
|
+
constructor(expr: MaybeTsDsl<WithString>);
|
|
11380
|
+
$render(): ts.PrefixUnaryExpression;
|
|
11381
|
+
}
|
|
11382
|
+
//#endregion
|
|
11383
|
+
//#region src/ts-dsl/object.d.ts
|
|
11384
|
+
declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
|
|
11385
|
+
private static readonly DEFAULT_THRESHOLD;
|
|
11386
|
+
private layout;
|
|
11387
|
+
private props;
|
|
11388
|
+
/** Sets automatic line output with optional threshold (default: 3). */
|
|
11389
|
+
auto(threshold?: number): this;
|
|
11390
|
+
/** Adds a getter property (e.g. `{ get foo() { ... } }`). */
|
|
11391
|
+
getter(name: string, expr: WithString<MaybeTsDsl<ts.Statement>>): this;
|
|
11392
|
+
/** Returns true if object has at least one property or spread. */
|
|
11393
|
+
hasProps(): boolean;
|
|
11394
|
+
/** Sets single line output. */
|
|
11395
|
+
inline(): this;
|
|
11396
|
+
/** Returns true if object has no properties or spreads. */
|
|
11397
|
+
get isEmpty(): boolean;
|
|
11398
|
+
/** Sets multi line output. */
|
|
11399
|
+
pretty(): this;
|
|
11400
|
+
/** Adds a property assignment. */
|
|
11401
|
+
prop(name: string, expr: MaybeTsDsl<WithString>): this;
|
|
11402
|
+
/** Adds a setter property (e.g. `{ set foo(v) { ... } }`). */
|
|
11403
|
+
setter(name: string, expr: WithString<MaybeTsDsl<ts.Statement>>): this;
|
|
11404
|
+
/** Adds a spread property (e.g. `{ ...options }`). */
|
|
11405
|
+
spread(expr: MaybeTsDsl<WithString>): this;
|
|
11406
|
+
/** Builds and returns the object literal expression. */
|
|
11407
|
+
$render(): ts.ObjectLiteralExpression;
|
|
11408
|
+
private safePropertyName;
|
|
11409
|
+
}
|
|
11410
|
+
//#endregion
|
|
11411
|
+
//#region src/ts-dsl/pattern.d.ts
|
|
11412
|
+
/**
|
|
11413
|
+
* Builds binding patterns (e.g. `{ foo, bar }`, `[a, b, ...rest]`).
|
|
11414
|
+
*/
|
|
11415
|
+
declare class PatternTsDsl extends TsDsl<ts.BindingName> {
|
|
11416
|
+
private pattern?;
|
|
11417
|
+
private _spread?;
|
|
11418
|
+
/** Defines an array pattern (e.g. `[a, b, c]`). */
|
|
11419
|
+
array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
|
|
11420
|
+
/** Defines an object pattern (e.g. `{ a, b: alias }`). */
|
|
11421
|
+
object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
|
|
11422
|
+
/** Adds a spread element (e.g. `...rest`, `...options`, `...args`). */
|
|
11423
|
+
spread(name: string): this;
|
|
11424
|
+
/** Builds and returns a BindingName (ObjectBindingPattern, ArrayBindingPattern, or Identifier). */
|
|
11425
|
+
$render(): ts.BindingName;
|
|
11426
|
+
private createSpread;
|
|
11427
|
+
}
|
|
11428
|
+
//#endregion
|
|
11429
|
+
//#region src/ts-dsl/regexp.d.ts
|
|
11430
|
+
type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u' | 'y';
|
|
11431
|
+
type RegexFlags<Avail extends string = RegexFlag> = '' | { [K in Avail]: `${K}${RegexFlags<Exclude<Avail, K>>}` }[Avail];
|
|
11432
|
+
declare class RegExpTsDsl extends TsDsl<ts.RegularExpressionLiteral> {
|
|
11433
|
+
private pattern;
|
|
11434
|
+
private flags?;
|
|
11435
|
+
constructor(pattern: string, flags?: RegexFlags);
|
|
11436
|
+
/** Emits a RegularExpressionLiteral node. */
|
|
11437
|
+
$render(): ts.RegularExpressionLiteral;
|
|
11438
|
+
}
|
|
11439
|
+
//#endregion
|
|
11440
|
+
//#region src/ts-dsl/setter.d.ts
|
|
11441
|
+
declare class SetterTsDsl extends TsDsl<ts.SetAccessorDeclaration> {
|
|
11442
|
+
private modifiers;
|
|
11443
|
+
private name;
|
|
11444
|
+
constructor(name: string, fn?: (s: SetterTsDsl) => void);
|
|
11445
|
+
$render(): ts.SetAccessorDeclaration;
|
|
11446
|
+
}
|
|
11447
|
+
interface SetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DescribeMixin, DoMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
|
|
11448
|
+
//#endregion
|
|
11449
|
+
//#region src/ts-dsl/template.d.ts
|
|
11450
|
+
declare class TemplateTsDsl extends TsDsl<ts.TemplateExpression | ts.NoSubstitutionTemplateLiteral> {
|
|
11451
|
+
private parts;
|
|
11452
|
+
constructor(value?: MaybeTsDsl<WithString>);
|
|
11453
|
+
add(value: MaybeTsDsl<WithString>): this;
|
|
11454
|
+
$render(): ts.TemplateExpression | ts.NoSubstitutionTemplateLiteral;
|
|
11455
|
+
}
|
|
11456
|
+
//#endregion
|
|
11457
|
+
//#region src/ts-dsl/throw.d.ts
|
|
11458
|
+
declare class ThrowTsDsl extends TsDsl<ts.ThrowStatement> {
|
|
11459
|
+
private error;
|
|
11460
|
+
private msg?;
|
|
11461
|
+
private useNew;
|
|
11462
|
+
constructor(error: MaybeTsDsl<WithString>, useNew?: boolean);
|
|
11463
|
+
message(value: MaybeTsDsl<WithString>): this;
|
|
11464
|
+
$render(): ts.ThrowStatement;
|
|
11465
|
+
}
|
|
11466
|
+
//#endregion
|
|
11467
|
+
//#region src/ts-dsl/type/alias.d.ts
|
|
11468
|
+
declare class TypeAliasTsDsl extends TsDsl<ts.TypeAliasDeclaration> {
|
|
11469
|
+
private value?;
|
|
11470
|
+
private modifiers;
|
|
11471
|
+
private name;
|
|
11472
|
+
constructor(name: string, fn?: (t: TypeAliasTsDsl) => void);
|
|
11473
|
+
/** Sets the type expression on the right-hand side of `= ...`. */
|
|
11474
|
+
type(node: MaybeTsDsl<ts.TypeNode>): this;
|
|
11475
|
+
/** Renders a `TypeAliasDeclaration` node. */
|
|
11476
|
+
$render(): ts.TypeAliasDeclaration;
|
|
11477
|
+
}
|
|
11478
|
+
interface TypeAliasTsDsl extends ExportMixin, TypeParamsMixin {}
|
|
11479
|
+
//#endregion
|
|
11480
|
+
//#region src/ts-dsl/type/literal.d.ts
|
|
11481
|
+
declare class TypeLiteralTsDsl extends TypeTsDsl<ts.LiteralTypeNode> {
|
|
11482
|
+
private value;
|
|
11483
|
+
constructor(value: string | number | boolean);
|
|
11484
|
+
$render(): ts.LiteralTypeNode;
|
|
11485
|
+
}
|
|
11486
|
+
//#endregion
|
|
11487
|
+
//#region src/ts-dsl/type/object.d.ts
|
|
11488
|
+
declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
|
|
11489
|
+
private props;
|
|
11490
|
+
private merges;
|
|
11491
|
+
/** Adds a property signature (returns property builder). */
|
|
11492
|
+
prop(name: string, fn: (p: TypePropTsDsl) => void): this;
|
|
11493
|
+
/** Adds a type to merge (intersect) with the object literal. */
|
|
11494
|
+
merge(type: WithString<ts.Identifier>): this;
|
|
11495
|
+
$render(): ts.TypeNode;
|
|
11496
|
+
}
|
|
11497
|
+
declare class TypePropTsDsl extends TypeTsDsl<ts.TypeElement> {
|
|
11498
|
+
private name;
|
|
11499
|
+
private typeInput?;
|
|
11500
|
+
constructor(name: string, fn: (p: TypePropTsDsl) => void);
|
|
11501
|
+
/** Sets the property type. */
|
|
11502
|
+
type(type: WithString<ts.TypeNode>): this;
|
|
11503
|
+
/** Builds and returns the property signature. */
|
|
11504
|
+
$render(): ts.TypeElement;
|
|
11505
|
+
}
|
|
11506
|
+
interface TypePropTsDsl extends OptionalMixin {}
|
|
11507
|
+
//#endregion
|
|
11508
|
+
//#region src/ts-dsl/var.d.ts
|
|
11509
|
+
declare class VarTsDsl extends TsDsl<ts.VariableStatement> {
|
|
11510
|
+
private kind;
|
|
11511
|
+
private modifiers;
|
|
11512
|
+
private name?;
|
|
11513
|
+
private _type?;
|
|
11514
|
+
constructor(name?: string);
|
|
11515
|
+
const(): this;
|
|
11516
|
+
let(): this;
|
|
11517
|
+
/** Sets the variable type. */
|
|
11518
|
+
type(type: string | TypeTsDsl): this;
|
|
11519
|
+
var(): this;
|
|
11520
|
+
$render(): ts.VariableStatement;
|
|
11521
|
+
}
|
|
11522
|
+
interface VarTsDsl extends DefaultMixin, DescribeMixin, ExportMixin, PatternMixin, ValueMixin {}
|
|
11523
|
+
//#endregion
|
|
11524
|
+
//#region src/ts-dsl/index.d.ts
|
|
11525
|
+
declare const $: ((id: string | typescript422.Expression | TsDsl<typescript422.Expression>) => ExprTsDsl) & {
|
|
11526
|
+
/** Creates an array literal expression (e.g. `[1, 2, 3]`). */
|
|
11527
|
+
array: () => ArrayTsDsl;
|
|
11528
|
+
/** Creates a property access expression (e.g. `obj.foo`). */
|
|
11529
|
+
attr: (left: string | typescript422.Expression | TsDsl<typescript422.Expression>, right: number | WithString<typescript422.MemberName>) => AttrTsDsl;
|
|
11530
|
+
/** Creates an await expression (e.g. `await promise`). */
|
|
11531
|
+
await: (expr: string | typescript422.Expression | TsDsl<typescript422.Expression>) => AwaitTsDsl;
|
|
11532
|
+
/** Creates a binary expression (e.g. `a + b`). */
|
|
11533
|
+
binary: (left: string | typescript422.Expression | TsDsl<typescript422.Expression>, operator: ("!=" | "!==" | "&&" | "*" | "+" | "-" | "/" | "<" | "<=" | "=" | "==" | "===" | ">" | ">=" | "??" | "||") | typescript422.BinaryOperator, right: string | typescript422.Expression | TsDsl<typescript422.Expression>) => BinaryTsDsl;
|
|
11534
|
+
/** Creates a function or method call expression (e.g. `fn(arg)`). */
|
|
11535
|
+
call: (callee: string | typescript422.Expression | TsDsl<typescript422.Expression>, ...args: (string | typescript422.Expression | TsDsl<typescript422.Expression> | undefined)[]) => CallTsDsl;
|
|
11536
|
+
/** Creates a class declaration or expression. */
|
|
11537
|
+
class: (name: string) => ClassTsDsl;
|
|
11538
|
+
/** Creates a constant variable declaration (`const`). */
|
|
11539
|
+
const: (name?: string | undefined) => VarTsDsl;
|
|
11540
|
+
/** Creates a decorator expression (e.g. `@decorator`). */
|
|
11541
|
+
decorator: (name: WithString, ...args: (string | typescript422.Expression | TsDsl<typescript422.Expression>)[]) => DecoratorTsDsl;
|
|
11542
|
+
/** Creates a describe block (used for tests or descriptions). */
|
|
11543
|
+
describe: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: DescribeTsDsl) => void) | undefined) => DescribeTsDsl;
|
|
11544
|
+
/** Creates a general expression node. */
|
|
11545
|
+
expr: (id: string | typescript422.Expression | TsDsl<typescript422.Expression>) => ExprTsDsl;
|
|
11546
|
+
/** Creates a field declaration in a class or object. */
|
|
11547
|
+
field: (name: string, fn?: ((f: FieldTsDsl) => void) | undefined) => FieldTsDsl;
|
|
11548
|
+
/** Creates a function expression or declaration. */
|
|
11549
|
+
func: {
|
|
11550
|
+
(): FuncTsDsl<"arrow">;
|
|
11551
|
+
(fn: (f: FuncTsDsl<"arrow">) => void): FuncTsDsl<"arrow">;
|
|
11552
|
+
(name: string): FuncTsDsl<"decl">;
|
|
11553
|
+
(name: string, fn: (f: FuncTsDsl<"decl">) => void): FuncTsDsl<"decl">;
|
|
11554
|
+
};
|
|
11555
|
+
/** Creates a getter method declaration. */
|
|
11556
|
+
getter: (name: string, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
|
|
11557
|
+
/** Creates an if statement. */
|
|
11558
|
+
if: (condition?: string | typescript422.Expression | TsDsl<typescript422.Expression> | undefined) => IfTsDsl;
|
|
11559
|
+
/** Creates an initialization block or statement. */
|
|
11560
|
+
init: (fn?: ((i: InitTsDsl) => void) | undefined) => InitTsDsl;
|
|
11561
|
+
/** Creates a let variable declaration (`let`). */
|
|
11562
|
+
let: (name?: string | undefined) => VarTsDsl;
|
|
11563
|
+
/** Creates a literal value (e.g. string, number, boolean). */
|
|
11564
|
+
literal: (value: string | number | boolean) => LiteralTsDsl;
|
|
11565
|
+
/** Creates a method declaration inside a class or object. */
|
|
11566
|
+
method: (name: string, fn?: ((m: MethodTsDsl) => void) | undefined) => MethodTsDsl;
|
|
11567
|
+
/** Creates a new expression (e.g. `new ClassName()`). */
|
|
11568
|
+
new: (classExpr: string | typescript422.Expression | TsDsl<typescript422.Expression>, ...args: (string | typescript422.Expression | TsDsl<typescript422.Expression>)[]) => NewTsDsl;
|
|
11569
|
+
/** Creates a newline (for formatting purposes). */
|
|
11570
|
+
newline: () => NewlineTsDsl;
|
|
11571
|
+
/** Creates a logical NOT expression (e.g. `!expr`). */
|
|
11572
|
+
not: (expr: string | typescript422.Expression | TsDsl<typescript422.Expression>) => NotTsDsl;
|
|
11573
|
+
/** Creates an object literal expression. */
|
|
11574
|
+
object: () => ObjectTsDsl;
|
|
11575
|
+
/** Creates a parameter declaration for functions or methods. */
|
|
11576
|
+
param: (name: string | ((p: ParamTsDsl) => void), fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
|
|
11577
|
+
/** Creates a pattern for destructuring or matching. */
|
|
11578
|
+
pattern: () => PatternTsDsl;
|
|
11579
|
+
/** Creates a regular expression literal (e.g. `/foo/gi`). */
|
|
11580
|
+
regexp: (pattern: string, flags?: ("" | "g" | "i" | "m" | "s" | "u" | "y" | "uy" | "yu" | "su" | "sy" | "suy" | "syu" | "ys" | "us" | "usy" | "uys" | "ysu" | "yus" | "ms" | "mu" | "my" | "muy" | "myu" | "msu" | "msy" | "msuy" | "msyu" | "mys" | "mus" | "musy" | "muys" | "mysu" | "myus" | "ym" | "um" | "umy" | "uym" | "ymu" | "yum" | "sm" | "smu" | "smy" | "smuy" | "smyu" | "sym" | "sum" | "sumy" | "suym" | "symu" | "syum" | "yms" | "ysm" | "ums" | "umsy" | "umys" | "usm" | "usmy" | "usym" | "uyms" | "uysm" | "ymsu" | "ymus" | "ysmu" | "ysum" | "yums" | "yusm" | "im" | "is" | "iu" | "iy" | "iuy" | "iyu" | "isu" | "isy" | "isuy" | "isyu" | "iys" | "ius" | "iusy" | "iuys" | "iysu" | "iyus" | "ims" | "imu" | "imy" | "imuy" | "imyu" | "imsu" | "imsy" | "imsuy" | "imsyu" | "imys" | "imus" | "imusy" | "imuys" | "imysu" | "imyus" | "iym" | "ium" | "iumy" | "iuym" | "iymu" | "iyum" | "ism" | "ismu" | "ismy" | "ismuy" | "ismyu" | "isym" | "isum" | "isumy" | "isuym" | "isymu" | "isyum" | "iyms" | "iysm" | "iums" | "iumsy" | "iumys" | "iusm" | "iusmy" | "iusym" | "iuyms" | "iuysm" | "iymsu" | "iymus" | "iysmu" | "iysum" | "iyums" | "iyusm" | "yi" | "ui" | "uiy" | "uyi" | "yiu" | "yui" | "si" | "siu" | "siy" | "siuy" | "siyu" | "syi" | "sui" | "suiy" | "suyi" | "syiu" | "syui" | "yis" | "ysi" | "uis" | "uisy" | "uiys" | "usi" | "usiy" | "usyi" | "uyis" | "uysi" | "yisu" | "yius" | "ysiu" | "ysui" | "yuis" | "yusi" | "mi" | "mis" | "miu" | "miy" | "miuy" | "miyu" | "misu" | "misy" | "misuy" | "misyu" | "miys" | "mius" | "miusy" | "miuys" | "miysu" | "miyus" | "myi" | "mui" | "muiy" | "muyi" | "myiu" | "myui" | "msi" | "msiu" | "msiy" | "msiuy" | "msiyu" | "msyi" | "msui" | "msuiy" | "msuyi" | "msyiu" | "msyui" | "myis" | "mysi" | "muis" | "muisy" | "muiys" | "musi" | "musiy" | "musyi" | "muyis" | "muysi" | "myisu" | "myius" | "mysiu" | "mysui" | "myuis" | "myusi" | "yim" | "ymi" | "uim" | "uimy" | "uiym" | "umi" | "umiy" | "umyi" | "uyim" | "uymi" | "yimu" | "yium" | "ymiu" | "ymui" | "yuim" | "yumi" | "sim" | "simu" | "simy" | "simuy" | "simyu" | "siym" | "sium" | "siumy" | "siuym" | "siymu" | "siyum" | "smi" | "smiu" | "smiy" | "smiuy" | "smiyu" | "smyi" | "smui" | "smuiy" | "smuyi" | "smyiu" | "smyui" | "syim" | "symi" | "suim" | "suimy" | "suiym" | "sumi" | "sumiy" | "sumyi" | "suyim" | "suymi" | "syimu" | "syium" | "symiu" | "symui" | "syuim" | "syumi" | "yims" | "yism" | "ymis" | "ymsi" | "ysim" | "ysmi" | "uims" | "uimsy" | "uimys" | "uism" | "uismy" | "uisym" | "uiyms" | "uiysm" | "umis" | "umisy" | "umiys" | "umsi" | "umsiy" | "umsyi" | "umyis" | "umysi" | "usim" | "usimy" | "usiym" | "usmi" | "usmiy" | "usmyi" | "usyim" | "usymi" | "uyims" | "uyism" | "uymis" | "uymsi" | "uysim" | "uysmi" | "yimsu" | "yimus" | "yismu" | "yisum" | "yiums" | "yiusm" | "ymisu" | "ymius" | "ymsiu" | "ymsui" | "ymuis" | "ymusi" | "ysimu" | "ysium" | "ysmiu" | "ysmui" | "ysuim" | "ysumi" | "yuims" | "yuism" | "yumis" | "yumsi" | "yusim" | "yusmi" | "gi" | "gm" | "gs" | "gu" | "gy" | "guy" | "gyu" | "gsu" | "gsy" | "gsuy" | "gsyu" | "gys" | "gus" | "gusy" | "guys" | "gysu" | "gyus" | "gms" | "gmu" | "gmy" | "gmuy" | "gmyu" | "gmsu" | "gmsy" | "gmsuy" | "gmsyu" | "gmys" | "gmus" | "gmusy" | "gmuys" | "gmysu" | "gmyus" | "gym" | "gum" | "gumy" | "guym" | "gymu" | "gyum" | "gsm" | "gsmu" | "gsmy" | "gsmuy" | "gsmyu" | "gsym" | "gsum" | "gsumy" | "gsuym" | "gsymu" | "gsyum" | "gyms" | "gysm" | "gums" | "gumsy" | "gumys" | "gusm" | "gusmy" | "gusym" | "guyms" | "guysm" | "gymsu" | "gymus" | "gysmu" | "gysum" | "gyums" | "gyusm" | "gim" | "gis" | "giu" | "giy" | "giuy" | "giyu" | "gisu" | "gisy" | "gisuy" | "gisyu" | "giys" | "gius" | "giusy" | "giuys" | "giysu" | "giyus" | "gims" | "gimu" | "gimy" | "gimuy" | "gimyu" | "gimsu" | "gimsy" | "gimsuy" | "gimsyu" | "gimys" | "gimus" | "gimusy" | "gimuys" | "gimysu" | "gimyus" | "giym" | "gium" | "giumy" | "giuym" | "giymu" | "giyum" | "gism" | "gismu" | "gismy" | "gismuy" | "gismyu" | "gisym" | "gisum" | "gisumy" | "gisuym" | "gisymu" | "gisyum" | "giyms" | "giysm" | "giums" | "giumsy" | "giumys" | "giusm" | "giusmy" | "giusym" | "giuyms" | "giuysm" | "giymsu" | "giymus" | "giysmu" | "giysum" | "giyums" | "giyusm" | "gyi" | "gui" | "guiy" | "guyi" | "gyiu" | "gyui" | "gsi" | "gsiu" | "gsiy" | "gsiuy" | "gsiyu" | "gsyi" | "gsui" | "gsuiy" | "gsuyi" | "gsyiu" | "gsyui" | "gyis" | "gysi" | "guis" | "guisy" | "guiys" | "gusi" | "gusiy" | "gusyi" | "guyis" | "guysi" | "gyisu" | "gyius" | "gysiu" | "gysui" | "gyuis" | "gyusi" | "gmi" | "gmis" | "gmiu" | "gmiy" | "gmiuy" | "gmiyu" | "gmisu" | "gmisy" | "gmisuy" | "gmisyu" | "gmiys" | "gmius" | "gmiusy" | "gmiuys" | "gmiysu" | "gmiyus" | "gmyi" | "gmui" | "gmuiy" | "gmuyi" | "gmyiu" | "gmyui" | "gmsi" | "gmsiu" | "gmsiy" | "gmsiuy" | "gmsiyu" | "gmsyi" | "gmsui" | "gmsuiy" | "gmsuyi" | "gmsyiu" | "gmsyui" | "gmyis" | "gmysi" | "gmuis" | "gmuisy" | "gmuiys" | "gmusi" | "gmusiy" | "gmusyi" | "gmuyis" | "gmuysi" | "gmyisu" | "gmyius" | "gmysiu" | "gmysui" | "gmyuis" | "gmyusi" | "gyim" | "gymi" | "guim" | "guimy" | "guiym" | "gumi" | "gumiy" | "gumyi" | "guyim" | "guymi" | "gyimu" | "gyium" | "gymiu" | "gymui" | "gyuim" | "gyumi" | "gsim" | "gsimu" | "gsimy" | "gsimuy" | "gsimyu" | "gsiym" | "gsium" | "gsiumy" | "gsiuym" | "gsiymu" | "gsiyum" | "gsmi" | "gsmiu" | "gsmiy" | "gsmiuy" | "gsmiyu" | "gsmyi" | "gsmui" | "gsmuiy" | "gsmuyi" | "gsmyiu" | "gsmyui" | "gsyim" | "gsymi" | "gsuim" | "gsuimy" | "gsuiym" | "gsumi" | "gsumiy" | "gsumyi" | "gsuyim" | "gsuymi" | "gsyimu" | "gsyium" | "gsymiu" | "gsymui" | "gsyuim" | "gsyumi" | "gyims" | "gyism" | "gymis" | "gymsi" | "gysim" | "gysmi" | "guims" | "guimsy" | "guimys" | "guism" | "guismy" | "guisym" | "guiyms" | "guiysm" | "gumis" | "gumisy" | "gumiys" | "gumsi" | "gumsiy" | "gumsyi" | "gumyis" | "gumysi" | "gusim" | "gusimy" | "gusiym" | "gusmi" | "gusmiy" | "gusmyi" | "gusyim" | "gusymi" | "guyims" | "guyism" | "guymis" | "guymsi" | "guysim" | "guysmi" | "gyimsu" | "gyimus" | "gyismu" | "gyisum" | "gyiums" | "gyiusm" | "gymisu" | "gymius" | "gymsiu" | "gymsui" | "gymuis" | "gymusi" | "gysimu" | "gysium" | "gysmiu" | "gysmui" | "gysuim" | "gysumi" | "gyuims" | "gyuism" | "gyumis" | "gyumsi" | "gyusim" | "gyusmi" | "yg" | "ug" | "ugy" | "uyg" | "ygu" | "yug" | "sg" | "sgu" | "sgy" | "sguy" | "sgyu" | "syg" | "sug" | "sugy" | "suyg" | "sygu" | "syug" | "ygs" | "ysg" | "ugs" | "ugsy" | "ugys" | "usg" | "usgy" | "usyg" | "uygs" | "uysg" | "ygsu" | "ygus" | "ysgu" | "ysug" | "yugs" | "yusg" | "mg" | "mgs" | "mgu" | "mgy" | "mguy" | "mgyu" | "mgsu" | "mgsy" | "mgsuy" | "mgsyu" | "mgys" | "mgus" | "mgusy" | "mguys" | "mgysu" | "mgyus" | "myg" | "mug" | "mugy" | "muyg" | "mygu" | "myug" | "msg" | "msgu" | "msgy" | "msguy" | "msgyu" | "msyg" | "msug" | "msugy" | "msuyg" | "msygu" | "msyug" | "mygs" | "mysg" | "mugs" | "mugsy" | "mugys" | "musg" | "musgy" | "musyg" | "muygs" | "muysg" | "mygsu" | "mygus" | "mysgu" | "mysug" | "myugs" | "myusg" | "ygm" | "ymg" | "ugm" | "ugmy" | "ugym" | "umg" | "umgy" | "umyg" | "uygm" | "uymg" | "ygmu" | "ygum" | "ymgu" | "ymug" | "yugm" | "yumg" | "sgm" | "sgmu" | "sgmy" | "sgmuy" | "sgmyu" | "sgym" | "sgum" | "sgumy" | "sguym" | "sgymu" | "sgyum" | "smg" | "smgu" | "smgy" | "smguy" | "smgyu" | "smyg" | "smug" | "smugy" | "smuyg" | "smygu" | "smyug" | "sygm" | "symg" | "sugm" | "sugmy" | "sugym" | "sumg" | "sumgy" | "sumyg" | "suygm" | "suymg" | "sygmu" | "sygum" | "symgu" | "symug" | "syugm" | "syumg" | "ygms" | "ygsm" | "ymgs" | "ymsg" | "ysgm" | "ysmg" | "ugms" | "ugmsy" | "ugmys" | "ugsm" | "ugsmy" | "ugsym" | "ugyms" | "ugysm" | "umgs" | "umgsy" | "umgys" | "umsg" | "umsgy" | "umsyg" | "umygs" | "umysg" | "usgm" | "usgmy" | "usgym" | "usmg" | "usmgy" | "usmyg" | "usygm" | "usymg" | "uygms" | "uygsm" | "uymgs" | "uymsg" | "uysgm" | "uysmg" | "ygmsu" | "ygmus" | "ygsmu" | "ygsum" | "ygums" | "ygusm" | "ymgsu" | "ymgus" | "ymsgu" | "ymsug" | "ymugs" | "ymusg" | "ysgmu" | "ysgum" | "ysmgu" | "ysmug" | "ysugm" | "ysumg" | "yugms" | "yugsm" | "yumgs" | "yumsg" | "yusgm" | "yusmg" | "ig" | "igm" | "igs" | "igu" | "igy" | "iguy" | "igyu" | "igsu" | "igsy" | "igsuy" | "igsyu" | "igys" | "igus" | "igusy" | "iguys" | "igysu" | "igyus" | "igms" | "igmu" | "igmy" | "igmuy" | "igmyu" | "igmsu" | "igmsy" | "igmsuy" | "igmsyu" | "igmys" | "igmus" | "igmusy" | "igmuys" | "igmysu" | "igmyus" | "igym" | "igum" | "igumy" | "iguym" | "igymu" | "igyum" | "igsm" | "igsmu" | "igsmy" | "igsmuy" | "igsmyu" | "igsym" | "igsum" | "igsumy" | "igsuym" | "igsymu" | "igsyum" | "igyms" | "igysm" | "igums" | "igumsy" | "igumys" | "igusm" | "igusmy" | "igusym" | "iguyms" | "iguysm" | "igymsu" | "igymus" | "igysmu" | "igysum" | "igyums" | "igyusm" | "iyg" | "iug" | "iugy" | "iuyg" | "iygu" | "iyug" | "isg" | "isgu" | "isgy" | "isguy" | "isgyu" | "isyg" | "isug" | "isugy" | "isuyg" | "isygu" | "isyug" | "iygs" | "iysg" | "iugs" | "iugsy" | "iugys" | "iusg" | "iusgy" | "iusyg" | "iuygs" | "iuysg" | "iygsu" | "iygus" | "iysgu" | "iysug" | "iyugs" | "iyusg" | "img" | "imgs" | "imgu" | "imgy" | "imguy" | "imgyu" | "imgsu" | "imgsy" | "imgsuy" | "imgsyu" | "imgys" | "imgus" | "imgusy" | "imguys" | "imgysu" | "imgyus" | "imyg" | "imug" | "imugy" | "imuyg" | "imygu" | "imyug" | "imsg" | "imsgu" | "imsgy" | "imsguy" | "imsgyu" | "imsyg" | "imsug" | "imsugy" | "imsuyg" | "imsygu" | "imsyug" | "imygs" | "imysg" | "imugs" | "imugsy" | "imugys" | "imusg" | "imusgy" | "imusyg" | "imuygs" | "imuysg" | "imygsu" | "imygus" | "imysgu" | "imysug" | "imyugs" | "imyusg" | "iygm" | "iymg" | "iugm" | "iugmy" | "iugym" | "iumg" | "iumgy" | "iumyg" | "iuygm" | "iuymg" | "iygmu" | "iygum" | "iymgu" | "iymug" | "iyugm" | "iyumg" | "isgm" | "isgmu" | "isgmy" | "isgmuy" | "isgmyu" | "isgym" | "isgum" | "isgumy" | "isguym" | "isgymu" | "isgyum" | "ismg" | "ismgu" | "ismgy" | "ismguy" | "ismgyu" | "ismyg" | "ismug" | "ismugy" | "ismuyg" | "ismygu" | "ismyug" | "isygm" | "isymg" | "isugm" | "isugmy" | "isugym" | "isumg" | "isumgy" | "isumyg" | "isuygm" | "isuymg" | "isygmu" | "isygum" | "isymgu" | "isymug" | "isyugm" | "isyumg" | "iygms" | "iygsm" | "iymgs" | "iymsg" | "iysgm" | "iysmg" | "iugms" | "iugmsy" | "iugmys" | "iugsm" | "iugsmy" | "iugsym" | "iugyms" | "iugysm" | "iumgs" | "iumgsy" | "iumgys" | "iumsg" | "iumsgy" | "iumsyg" | "iumygs" | "iumysg" | "iusgm" | "iusgmy" | "iusgym" | "iusmg" | "iusmgy" | "iusmyg" | "iusygm" | "iusymg" | "iuygms" | "iuygsm" | "iuymgs" | "iuymsg" | "iuysgm" | "iuysmg" | "iygmsu" | "iygmus" | "iygsmu" | "iygsum" | "iygums" | "iygusm" | "iymgsu" | "iymgus" | "iymsgu" | "iymsug" | "iymugs" | "iymusg" | "iysgmu" | "iysgum" | "iysmgu" | "iysmug" | "iysugm" | "iysumg" | "iyugms" | "iyugsm" | "iyumgs" | "iyumsg" | "iyusgm" | "iyusmg" | "ygi" | "yig" | "ugi" | "ugiy" | "ugyi" | "uig" | "uigy" | "uiyg" | "uygi" | "uyig" | "ygiu" | "ygui" | "yigu" | "yiug" | "yugi" | "yuig" | "sgi" | "sgiu" | "sgiy" | "sgiuy" | "sgiyu" | "sgyi" | "sgui" | "sguiy" | "sguyi" | "sgyiu" | "sgyui" | "sig" | "sigu" | "sigy" | "siguy" | "sigyu" | "siyg" | "siug" | "siugy" | "siuyg" | "siygu" | "siyug" | "sygi" | "syig" | "sugi" | "sugiy" | "sugyi" | "suig" | "suigy" | "suiyg" | "suygi" | "suyig" | "sygiu" | "sygui" | "syigu" | "syiug" | "syugi" | "syuig" | "ygis" | "ygsi" | "yigs" | "yisg" | "ysgi" | "ysig" | "ugis" | "ugisy" | "ugiys" | "ugsi" | "ugsiy" | "ugsyi" | "ugyis" | "ugysi" | "uigs" | "uigsy" | "uigys" | "uisg" | "uisgy" | "uisyg" | "uiygs" | "uiysg" | "usgi" | "usgiy" | "usgyi" | "usig" | "usigy" | "usiyg" | "usygi" | "usyig" | "uygis" | "uygsi" | "uyigs" | "uyisg" | "uysgi" | "uysig" | "ygisu" | "ygius" | "ygsiu" | "ygsui" | "yguis" | "ygusi" | "yigsu" | "yigus" | "yisgu" | "yisug" | "yiugs" | "yiusg" | "ysgiu" | "ysgui" | "ysigu" | "ysiug" | "ysugi" | "ysuig" | "yugis" | "yugsi" | "yuigs" | "yuisg" | "yusgi" | "yusig" | "mgi" | "mgis" | "mgiu" | "mgiy" | "mgiuy" | "mgiyu" | "mgisu" | "mgisy" | "mgisuy" | "mgisyu" | "mgiys" | "mgius" | "mgiusy" | "mgiuys" | "mgiysu" | "mgiyus" | "mgyi" | "mgui" | "mguiy" | "mguyi" | "mgyiu" | "mgyui" | "mgsi" | "mgsiu" | "mgsiy" | "mgsiuy" | "mgsiyu" | "mgsyi" | "mgsui" | "mgsuiy" | "mgsuyi" | "mgsyiu" | "mgsyui" | "mgyis" | "mgysi" | "mguis" | "mguisy" | "mguiys" | "mgusi" | "mgusiy" | "mgusyi" | "mguyis" | "mguysi" | "mgyisu" | "mgyius" | "mgysiu" | "mgysui" | "mgyuis" | "mgyusi" | "mig" | "migs" | "migu" | "migy" | "miguy" | "migyu" | "migsu" | "migsy" | "migsuy" | "migsyu" | "migys" | "migus" | "migusy" | "miguys" | "migysu" | "migyus" | "miyg" | "miug" | "miugy" | "miuyg" | "miygu" | "miyug" | "misg" | "misgu" | "misgy" | "misguy" | "misgyu" | "misyg" | "misug" | "misugy" | "misuyg" | "misygu" | "misyug" | "miygs" | "miysg" | "miugs" | "miugsy" | "miugys" | "miusg" | "miusgy" | "miusyg" | "miuygs" | "miuysg" | "miygsu" | "miygus" | "miysgu" | "miysug" | "miyugs" | "miyusg" | "mygi" | "myig" | "mugi" | "mugiy" | "mugyi" | "muig" | "muigy" | "muiyg" | "muygi" | "muyig" | "mygiu" | "mygui" | "myigu" | "myiug" | "myugi" | "myuig" | "msgi" | "msgiu" | "msgiy" | "msgiuy" | "msgiyu" | "msgyi" | "msgui" | "msguiy" | "msguyi" | "msgyiu" | "msgyui" | "msig" | "msigu" | "msigy" | "msiguy" | "msigyu" | "msiyg" | "msiug" | "msiugy" | "msiuyg" | "msiygu" | "msiyug" | "msygi" | "msyig" | "msugi" | "msugiy" | "msugyi" | "msuig" | "msuigy" | "msuiyg" | "msuygi" | "msuyig" | "msygiu" | "msygui" | "msyigu" | "msyiug" | "msyugi" | "msyuig" | "mygis" | "mygsi" | "myigs" | "myisg" | "mysgi" | "mysig" | "mugis" | "mugisy" | "mugiys" | "mugsi" | "mugsiy" | "mugsyi" | "mugyis" | "mugysi" | "muigs" | "muigsy" | "muigys" | "muisg" | "muisgy" | "muisyg" | "muiygs" | "muiysg" | "musgi" | "musgiy" | "musgyi" | "musig" | "musigy" | "musiyg" | "musygi" | "musyig" | "muygis" | "muygsi" | "muyigs" | "muyisg" | "muysgi" | "muysig" | "mygisu" | "mygius" | "mygsiu" | "mygsui" | "myguis" | "mygusi" | "myigsu" | "myigus" | "myisgu" | "myisug" | "myiugs" | "myiusg" | "mysgiu" | "mysgui" | "mysigu" | "mysiug" | "mysugi" | "mysuig" | "myugis" | "myugsi" | "myuigs" | "myuisg" | "myusgi" | "myusig" | "ygim" | "ygmi" | "yigm" | "yimg" | "ymgi" | "ymig" | "ugim" | "ugimy" | "ugiym" | "ugmi" | "ugmiy" | "ugmyi" | "ugyim" | "ugymi" | "uigm" | "uigmy" | "uigym" | "uimg" | "uimgy" | "uimyg" | "uiygm" | "uiymg" | "umgi" | "umgiy" | "umgyi" | "umig" | "umigy" | "umiyg" | "umygi" | "umyig" | "uygim" | "uygmi" | "uyigm" | "uyimg" | "uymgi" | "uymig" | "ygimu" | "ygium" | "ygmiu" | "ygmui" | "yguim" | "ygumi" | "yigmu" | "yigum" | "yimgu" | "yimug" | "yiugm" | "yiumg" | "ymgiu" | "ymgui" | "ymigu" | "ymiug" | "ymugi" | "ymuig" | "yugim" | "yugmi" | "yuigm" | "yuimg" | "yumgi" | "yumig" | "sgim" | "sgimu" | "sgimy" | "sgimuy" | "sgimyu" | "sgiym" | "sgium" | "sgiumy" | "sgiuym" | "sgiymu" | "sgiyum" | "sgmi" | "sgmiu" | "sgmiy" | "sgmiuy" | "sgmiyu" | "sgmyi" | "sgmui" | "sgmuiy" | "sgmuyi" | "sgmyiu" | "sgmyui" | "sgyim" | "sgymi" | "sguim" | "sguimy" | "sguiym" | "sgumi" | "sgumiy" | "sgumyi" | "sguyim" | "sguymi" | "sgyimu" | "sgyium" | "sgymiu" | "sgymui" | "sgyuim" | "sgyumi" | "sigm" | "sigmu" | "sigmy" | "sigmuy" | "sigmyu" | "sigym" | "sigum" | "sigumy" | "siguym" | "sigymu" | "sigyum" | "simg" | "simgu" | "simgy" | "simguy" | "simgyu" | "simyg" | "simug" | "simugy" | "simuyg" | "simygu" | "simyug" | "siygm" | "siymg" | "siugm" | "siugmy" | "siugym" | "siumg" | "siumgy" | "siumyg" | "siuygm" | "siuymg" | "siygmu" | "siygum" | "siymgu" | "siymug" | "siyugm" | "siyumg" | "smgi" | "smgiu" | "smgiy" | "smgiuy" | "smgiyu" | "smgyi" | "smgui" | "smguiy" | "smguyi" | "smgyiu" | "smgyui" | "smig" | "smigu" | "smigy" | "smiguy" | "smigyu" | "smiyg" | "smiug" | "smiugy" | "smiuyg" | "smiygu" | "smiyug" | "smygi" | "smyig" | "smugi" | "smugiy" | "smugyi" | "smuig" | "smuigy" | "smuiyg" | "smuygi" | "smuyig" | "smygiu" | "smygui" | "smyigu" | "smyiug" | "smyugi" | "smyuig" | "sygim" | "sygmi" | "syigm" | "syimg" | "symgi" | "symig" | "sugim" | "sugimy" | "sugiym" | "sugmi" | "sugmiy" | "sugmyi" | "sugyim" | "sugymi" | "suigm" | "suigmy" | "suigym" | "suimg" | "suimgy" | "suimyg" | "suiygm" | "suiymg" | "sumgi" | "sumgiy" | "sumgyi" | "sumig" | "sumigy" | "sumiyg" | "sumygi" | "sumyig" | "suygim" | "suygmi" | "suyigm" | "suyimg" | "suymgi" | "suymig" | "sygimu" | "sygium" | "sygmiu" | "sygmui" | "syguim" | "sygumi" | "syigmu" | "syigum" | "syimgu" | "syimug" | "syiugm" | "syiumg" | "symgiu" | "symgui" | "symigu" | "symiug" | "symugi" | "symuig" | "syugim" | "syugmi" | "syuigm" | "syuimg" | "syumgi" | "syumig" | "ygims" | "ygism" | "ygmis" | "ygmsi" | "ygsim" | "ygsmi" | "yigms" | "yigsm" | "yimgs" | "yimsg" | "yisgm" | "yismg" | "ymgis" | "ymgsi" | "ymigs" | "ymisg" | "ymsgi" | "ymsig" | "ysgim" | "ysgmi" | "ysigm" | "ysimg" | "ysmgi" | "ysmig" | "ugims" | "ugimsy" | "ugimys" | "ugism" | "ugismy" | "ugisym" | "ugiyms" | "ugiysm" | "ugmis" | "ugmisy" | "ugmiys" | "ugmsi" | "ugmsiy" | "ugmsyi" | "ugmyis" | "ugmysi" | "ugsim" | "ugsimy" | "ugsiym" | "ugsmi" | "ugsmiy" | "ugsmyi" | "ugsyim" | "ugsymi" | "ugyims" | "ugyism" | "ugymis" | "ugymsi" | "ugysim" | "ugysmi" | "uigms" | "uigmsy" | "uigmys" | "uigsm" | "uigsmy" | "uigsym" | "uigyms" | "uigysm" | "uimgs" | "uimgsy" | "uimgys" | "uimsg" | "uimsgy" | "uimsyg" | "uimygs" | "uimysg" | "uisgm" | "uisgmy" | "uisgym" | "uismg" | "uismgy" | "uismyg" | "uisygm" | "uisymg" | "uiygms" | "uiygsm" | "uiymgs" | "uiymsg" | "uiysgm" | "uiysmg" | "umgis" | "umgisy" | "umgiys" | "umgsi" | "umgsiy" | "umgsyi" | "umgyis" | "umgysi" | "umigs" | "umigsy" | "umigys" | "umisg" | "umisgy" | "umisyg" | "umiygs" | "umiysg" | "umsgi" | "umsgiy" | "umsgyi" | "umsig" | "umsigy" | "umsiyg" | "umsygi" | "umsyig" | "umygis" | "umygsi" | "umyigs" | "umyisg" | "umysgi" | "umysig" | "usgim" | "usgimy" | "usgiym" | "usgmi" | "usgmiy" | "usgmyi" | "usgyim" | "usgymi" | "usigm" | "usigmy" | "usigym" | "usimg" | "usimgy" | "usimyg" | "usiygm" | "usiymg" | "usmgi" | "usmgiy" | "usmgyi" | "usmig" | "usmigy" | "usmiyg" | "usmygi" | "usmyig" | "usygim" | "usygmi" | "usyigm" | "usyimg" | "usymgi" | "usymig" | "uygims" | "uygism" | "uygmis" | "uygmsi" | "uygsim" | "uygsmi" | "uyigms" | "uyigsm" | "uyimgs" | "uyimsg" | "uyisgm" | "uyismg" | "uymgis" | "uymgsi" | "uymigs" | "uymisg" | "uymsgi" | "uymsig" | "uysgim" | "uysgmi" | "uysigm" | "uysimg" | "uysmgi" | "uysmig" | "ygimsu" | "ygimus" | "ygismu" | "ygisum" | "ygiums" | "ygiusm" | "ygmisu" | "ygmius" | "ygmsiu" | "ygmsui" | "ygmuis" | "ygmusi" | "ygsimu" | "ygsium" | "ygsmiu" | "ygsmui" | "ygsuim" | "ygsumi" | "yguims" | "yguism" | "ygumis" | "ygumsi" | "ygusim" | "ygusmi" | "yigmsu" | "yigmus" | "yigsmu" | "yigsum" | "yigums" | "yigusm" | "yimgsu" | "yimgus" | "yimsgu" | "yimsug" | "yimugs" | "yimusg" | "yisgmu" | "yisgum" | "yismgu" | "yismug" | "yisugm" | "yisumg" | "yiugms" | "yiugsm" | "yiumgs" | "yiumsg" | "yiusgm" | "yiusmg" | "ymgisu" | "ymgius" | "ymgsiu" | "ymgsui" | "ymguis" | "ymgusi" | "ymigsu" | "ymigus" | "ymisgu" | "ymisug" | "ymiugs" | "ymiusg" | "ymsgiu" | "ymsgui" | "ymsigu" | "ymsiug" | "ymsugi" | "ymsuig" | "ymugis" | "ymugsi" | "ymuigs" | "ymuisg" | "ymusgi" | "ymusig" | "ysgimu" | "ysgium" | "ysgmiu" | "ysgmui" | "ysguim" | "ysgumi" | "ysigmu" | "ysigum" | "ysimgu" | "ysimug" | "ysiugm" | "ysiumg" | "ysmgiu" | "ysmgui" | "ysmigu" | "ysmiug" | "ysmugi" | "ysmuig" | "ysugim" | "ysugmi" | "ysuigm" | "ysuimg" | "ysumgi" | "ysumig" | "yugims" | "yugism" | "yugmis" | "yugmsi" | "yugsim" | "yugsmi" | "yuigms" | "yuigsm" | "yuimgs" | "yuimsg" | "yuisgm" | "yuismg" | "yumgis" | "yumgsi" | "yumigs" | "yumisg" | "yumsgi" | "yumsig" | "yusgim" | "yusgmi" | "yusigm" | "yusimg" | "yusmgi" | "yusmig") | undefined) => RegExpTsDsl;
|
|
11581
|
+
/** Creates a return statement. */
|
|
11582
|
+
return: (expr?: string | typescript422.Expression | TsDsl<typescript422.Expression> | undefined) => ReturnTsDsl;
|
|
11583
|
+
/** Creates a setter method declaration. */
|
|
11584
|
+
setter: (name: string, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
|
|
11585
|
+
/** Creates a template literal expression. */
|
|
11586
|
+
template: (value?: string | typescript422.Expression | TsDsl<typescript422.Expression> | undefined) => TemplateTsDsl;
|
|
11587
|
+
/** Creates a throw statement. */
|
|
11588
|
+
throw: (error: string | typescript422.Expression | TsDsl<typescript422.Expression>, useNew?: boolean | undefined) => ThrowTsDsl;
|
|
11589
|
+
/** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
|
|
11590
|
+
type: ((name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl) & {
|
|
11591
|
+
/** Creates a type alias declaration (e.g. `type Foo = Bar`). */
|
|
11592
|
+
alias: (name: string, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
|
|
11593
|
+
/** Creates a qualified type reference (e.g. Foo.Bar). */
|
|
11594
|
+
attr: (right: WithString<typescript422.Identifier>) => TypeAttrTsDsl;
|
|
11595
|
+
/** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
|
|
11596
|
+
expr: (name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl;
|
|
11597
|
+
/** Creates a literal type node (e.g. 'foo', 42, or true). */
|
|
11598
|
+
literal: (value: string | number | boolean) => TypeLiteralTsDsl;
|
|
11599
|
+
/** Creates a type literal node (e.g. { foo: string }). */
|
|
11600
|
+
object: () => TypeObjectTsDsl;
|
|
11601
|
+
};
|
|
11602
|
+
/** Creates a variable declaration (var). */
|
|
11603
|
+
var: (name?: string | undefined) => VarTsDsl;
|
|
11604
|
+
};
|
|
11605
|
+
type DollarTsDsl = {
|
|
11606
|
+
/**
|
|
11607
|
+
* Entry point to the TypeScript DSL.
|
|
11608
|
+
*
|
|
11609
|
+
* `$` creates a general expression node by default, but also exposes
|
|
11610
|
+
* builders for all other constructs such as `.type()`, `.call()`,
|
|
11611
|
+
* `.object()`, `.func()`, etc.
|
|
11612
|
+
*
|
|
11613
|
+
* Example:
|
|
11614
|
+
* ```ts
|
|
11615
|
+
* const node = $('console').attr('log').call($.literal('Hello'));
|
|
11616
|
+
* ```
|
|
11617
|
+
*
|
|
11618
|
+
* Returns:
|
|
11619
|
+
* - A new `ExprTsDsl` instance when called directly.
|
|
11620
|
+
* - The `base` factory object for constructing more specific nodes.
|
|
11621
|
+
*/
|
|
11622
|
+
$: typeof $;
|
|
11623
|
+
};
|
|
11624
|
+
//#endregion
|
|
10829
11625
|
//#region src/plugins/arktype/shared/types.d.ts
|
|
10830
11626
|
type ValidatorArgs$2 = {
|
|
10831
11627
|
operation: IR$1.OperationObject;
|
|
@@ -12095,7 +12891,7 @@ type IApi$1 = {
|
|
|
12095
12891
|
};
|
|
12096
12892
|
//#endregion
|
|
12097
12893
|
//#region src/plugins/valibot/types.d.ts
|
|
12098
|
-
type UserConfig$2 = Plugin.Name<'valibot'> & Plugin.Hooks & {
|
|
12894
|
+
type UserConfig$2 = Plugin.Name<'valibot'> & Plugin.Hooks & Resolvers$1 & {
|
|
12099
12895
|
/**
|
|
12100
12896
|
* The casing convention to use for generated names.
|
|
12101
12897
|
*
|
|
@@ -12253,7 +13049,7 @@ type UserConfig$2 = Plugin.Name<'valibot'> & Plugin.Hooks & {
|
|
|
12253
13049
|
name?: StringName;
|
|
12254
13050
|
};
|
|
12255
13051
|
};
|
|
12256
|
-
type Config$2 = Plugin.Name<'valibot'> & Plugin.Hooks & {
|
|
13052
|
+
type Config$2 = Plugin.Name<'valibot'> & Plugin.Hooks & Resolvers$1 & {
|
|
12257
13053
|
/**
|
|
12258
13054
|
* The casing convention to use for generated names.
|
|
12259
13055
|
*
|
|
@@ -12389,6 +13185,73 @@ type Config$2 = Plugin.Name<'valibot'> & Plugin.Hooks & {
|
|
|
12389
13185
|
name: StringName;
|
|
12390
13186
|
};
|
|
12391
13187
|
};
|
|
13188
|
+
type SharedResolverArgs$1 = DollarTsDsl & {
|
|
13189
|
+
/**
|
|
13190
|
+
* The current builder state being processed by this resolver.
|
|
13191
|
+
*
|
|
13192
|
+
* In Valibot, this represents the current list of call expressions ("pipes")
|
|
13193
|
+
* being assembled to form a schema definition.
|
|
13194
|
+
*
|
|
13195
|
+
* Each pipe can be extended, modified, or replaced to customize how the
|
|
13196
|
+
* resulting schema is constructed. Returning `undefined` from a resolver will
|
|
13197
|
+
* use the default generation behavior.
|
|
13198
|
+
*/
|
|
13199
|
+
pipes: Array<CallTsDsl>;
|
|
13200
|
+
plugin: ValibotPlugin['Instance'];
|
|
13201
|
+
};
|
|
13202
|
+
type FormatResolverArgs$1 = SharedResolverArgs$1 & {
|
|
13203
|
+
schema: IR$1.SchemaObject;
|
|
13204
|
+
};
|
|
13205
|
+
type ObjectBaseResolverArgs$1 = SharedResolverArgs$1 & {
|
|
13206
|
+
/** Null = never */
|
|
13207
|
+
additional?: ts.Expression | null;
|
|
13208
|
+
schema: IR$1.SchemaObject;
|
|
13209
|
+
shape: ObjectTsDsl;
|
|
13210
|
+
};
|
|
13211
|
+
type Resolvers$1 = Plugin.Resolvers<{
|
|
13212
|
+
/**
|
|
13213
|
+
* Resolvers for object schemas.
|
|
13214
|
+
*
|
|
13215
|
+
* Allows customization of how object types are rendered.
|
|
13216
|
+
*
|
|
13217
|
+
* Example path: `~resolvers.object.base`
|
|
13218
|
+
*
|
|
13219
|
+
* Returning `undefined` from a resolver will apply the default
|
|
13220
|
+
* generation behavior for the object schema.
|
|
13221
|
+
*/
|
|
13222
|
+
object?: {
|
|
13223
|
+
/**
|
|
13224
|
+
* Controls how object schemas are constructed.
|
|
13225
|
+
*
|
|
13226
|
+
* Called with the fully assembled shape (properties) and any additional
|
|
13227
|
+
* property schema, allowing the resolver to choose the correct Valibot
|
|
13228
|
+
* base constructor and modify the schema chain if needed.
|
|
13229
|
+
*
|
|
13230
|
+
* Returning `undefined` will execute the default resolver logic.
|
|
13231
|
+
*/
|
|
13232
|
+
base?: (args: ObjectBaseResolverArgs$1) => CallTsDsl | undefined;
|
|
13233
|
+
};
|
|
13234
|
+
/**
|
|
13235
|
+
* Resolvers for string schemas.
|
|
13236
|
+
*
|
|
13237
|
+
* Allows customization of how string types are rendered, including
|
|
13238
|
+
* per-format handling.
|
|
13239
|
+
*/
|
|
13240
|
+
string?: {
|
|
13241
|
+
/**
|
|
13242
|
+
* Resolvers for string formats (e.g., `uuid`, `email`, `date-time`).
|
|
13243
|
+
*
|
|
13244
|
+
* Each key represents a specific format name with a custom
|
|
13245
|
+
* resolver function that controls how that format is rendered.
|
|
13246
|
+
*
|
|
13247
|
+
* Example path: `~resolvers.string.formats.uuid`
|
|
13248
|
+
*
|
|
13249
|
+
* Returning `undefined` from a resolver will apply the default
|
|
13250
|
+
* generation behavior for that format.
|
|
13251
|
+
*/
|
|
13252
|
+
formats?: Record<string, (args: FormatResolverArgs$1) => boolean | number | undefined>;
|
|
13253
|
+
};
|
|
13254
|
+
}>;
|
|
12392
13255
|
type ValibotPlugin = DefinePlugin<UserConfig$2, Config$2, IApi$1>;
|
|
12393
13256
|
//#endregion
|
|
12394
13257
|
//#region src/plugins/zod/shared/types.d.ts
|
|
@@ -12404,7 +13267,7 @@ type IApi = {
|
|
|
12404
13267
|
};
|
|
12405
13268
|
//#endregion
|
|
12406
13269
|
//#region src/plugins/zod/types.d.ts
|
|
12407
|
-
type UserConfig$1 = Plugin.Name<'zod'> & Plugin.Hooks & {
|
|
13270
|
+
type UserConfig$1 = Plugin.Name<'zod'> & Plugin.Hooks & Resolvers & {
|
|
12408
13271
|
/**
|
|
12409
13272
|
* The casing convention to use for generated names.
|
|
12410
13273
|
*
|
|
@@ -12788,7 +13651,7 @@ type UserConfig$1 = Plugin.Name<'zod'> & Plugin.Hooks & {
|
|
|
12788
13651
|
};
|
|
12789
13652
|
};
|
|
12790
13653
|
};
|
|
12791
|
-
type Config$1 = Plugin.Name<'zod'> & Plugin.Hooks & {
|
|
13654
|
+
type Config$1 = Plugin.Name<'zod'> & Plugin.Hooks & Resolvers & {
|
|
12792
13655
|
/**
|
|
12793
13656
|
* The casing convention to use for generated names.
|
|
12794
13657
|
*
|
|
@@ -13109,6 +13972,72 @@ type Config$1 = Plugin.Name<'zod'> & Plugin.Hooks & {
|
|
|
13109
13972
|
};
|
|
13110
13973
|
};
|
|
13111
13974
|
};
|
|
13975
|
+
type SharedResolverArgs = DollarTsDsl & {
|
|
13976
|
+
/**
|
|
13977
|
+
* The current fluent builder chain under construction for this resolver.
|
|
13978
|
+
*
|
|
13979
|
+
* Represents the in-progress call sequence (e.g., a Zod or DSL chain)
|
|
13980
|
+
* that defines the current schema or expression being generated.
|
|
13981
|
+
*
|
|
13982
|
+
* This chain can be extended, transformed, or replaced entirely to customize
|
|
13983
|
+
* the resulting output of the resolver.
|
|
13984
|
+
*/
|
|
13985
|
+
chain?: CallTsDsl;
|
|
13986
|
+
plugin: ZodPlugin['Instance'];
|
|
13987
|
+
};
|
|
13988
|
+
type FormatResolverArgs = Required<SharedResolverArgs> & {
|
|
13989
|
+
schema: IR$1.SchemaObject;
|
|
13990
|
+
};
|
|
13991
|
+
type ObjectBaseResolverArgs = SharedResolverArgs & {
|
|
13992
|
+
/** Null = never */
|
|
13993
|
+
additional?: ts.Expression | null;
|
|
13994
|
+
schema: IR$1.SchemaObject;
|
|
13995
|
+
shape: ObjectTsDsl;
|
|
13996
|
+
};
|
|
13997
|
+
type Resolvers = Plugin.Resolvers<{
|
|
13998
|
+
/**
|
|
13999
|
+
* Resolvers for object schemas.
|
|
14000
|
+
*
|
|
14001
|
+
* Allows customization of how object types are rendered.
|
|
14002
|
+
*
|
|
14003
|
+
* Example path: `~resolvers.object.base`
|
|
14004
|
+
*
|
|
14005
|
+
* Returning `undefined` from a resolver will apply the default
|
|
14006
|
+
* generation behavior for the object schema.
|
|
14007
|
+
*/
|
|
14008
|
+
object?: {
|
|
14009
|
+
/**
|
|
14010
|
+
* Controls how object schemas are constructed.
|
|
14011
|
+
*
|
|
14012
|
+
* Called with the fully assembled shape (properties) and any additional
|
|
14013
|
+
* property schema, allowing the resolver to choose the correct Zod
|
|
14014
|
+
* base constructor and modify the schema chain if needed.
|
|
14015
|
+
*
|
|
14016
|
+
* Returning `undefined` will execute the default resolver logic.
|
|
14017
|
+
*/
|
|
14018
|
+
base?: (args: ObjectBaseResolverArgs) => CallTsDsl | undefined;
|
|
14019
|
+
};
|
|
14020
|
+
/**
|
|
14021
|
+
* Resolvers for string schemas.
|
|
14022
|
+
*
|
|
14023
|
+
* Allows customization of how string types are rendered, including
|
|
14024
|
+
* per-format handling.
|
|
14025
|
+
*/
|
|
14026
|
+
string?: {
|
|
14027
|
+
/**
|
|
14028
|
+
* Resolvers for string formats (e.g., `uuid`, `email`, `date-time`).
|
|
14029
|
+
*
|
|
14030
|
+
* Each key represents a specific format name with a custom
|
|
14031
|
+
* resolver function that controls how that format is rendered.
|
|
14032
|
+
*
|
|
14033
|
+
* Example path: `~resolvers.string.formats.uuid`
|
|
14034
|
+
*
|
|
14035
|
+
* Returning `undefined` from a resolver will apply the default
|
|
14036
|
+
* generation logic for that format.
|
|
14037
|
+
*/
|
|
14038
|
+
formats?: Record<string, (args: FormatResolverArgs) => CallTsDsl | undefined>;
|
|
14039
|
+
};
|
|
14040
|
+
}>;
|
|
13112
14041
|
type ZodPlugin = DefinePlugin<UserConfig$1, Config$1, IApi>;
|
|
13113
14042
|
//#endregion
|
|
13114
14043
|
//#region src/plugins/config.d.ts
|
|
@@ -13656,6 +14585,23 @@ declare namespace Plugin {
|
|
|
13656
14585
|
export interface Name<Name extends PluginNames> {
|
|
13657
14586
|
name: Name;
|
|
13658
14587
|
}
|
|
14588
|
+
|
|
14589
|
+
/**
|
|
14590
|
+
* Generic wrapper for plugin resolvers.
|
|
14591
|
+
*
|
|
14592
|
+
* Provides a namespaced configuration entry (`~resolvers`)
|
|
14593
|
+
* where plugins can define how specific schema constructs
|
|
14594
|
+
* should be resolved or overridden.
|
|
14595
|
+
*/
|
|
14596
|
+
export type Resolvers<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
14597
|
+
/**
|
|
14598
|
+
* Custom behavior resolvers for a plugin.
|
|
14599
|
+
*
|
|
14600
|
+
* Used to define how specific schema constructs are
|
|
14601
|
+
* resolved into AST or runtime logic.
|
|
14602
|
+
*/
|
|
14603
|
+
'~resolvers'?: T;
|
|
14604
|
+
};
|
|
13659
14605
|
export type Types<Config$22 extends BaseConfig = BaseConfig, ResolvedConfig extends BaseConfig = Config$22, Api extends BaseApi = never> = ([Api] extends [never] ? {
|
|
13660
14606
|
api?: BaseApi;
|
|
13661
14607
|
} : {
|
|
@@ -14727,5 +15673,5 @@ type Config = Omit<Required<UserConfig>, 'input' | 'logs' | 'output' | 'parser'
|
|
|
14727
15673
|
plugins: { [K in PluginNames]?: Plugin.Config<PluginConfigMap[K]> };
|
|
14728
15674
|
};
|
|
14729
15675
|
//#endregion
|
|
14730
|
-
export { Client
|
|
14731
|
-
//# sourceMappingURL=config-
|
|
15676
|
+
export { Client as $, LiteralTsDsl as A, InitTsDsl as B, SetterTsDsl as C, NotTsDsl as D, ObjectTsDsl as E, TypeExprTsDsl as F, BinaryTsDsl as G, FieldTsDsl as H, TypeAttrTsDsl as I, AwaitTsDsl as J, ReturnTsDsl as K, DecoratorTsDsl as L, GetterTsDsl as M, FuncTsDsl as N, NewlineTsDsl as O, ExprTsDsl as P, ExpressionTransformer as Q, ClassTsDsl as R, TemplateTsDsl as S, PatternTsDsl as T, DescribeTsDsl as U, ParamTsDsl as V, AttrTsDsl as W, TsDsl as X, ArrayTsDsl as Y, TypeTransformer as Z, VarTsDsl as _, Plugin as a, Client$6 as at, TypeAliasTsDsl as b, OpenApiOperationObject as c, IR$1 as ct, OpenApiResponseObject as d, PluginHandler as et, OpenApiSchemaObject as f, DollarTsDsl as g, $ as h, DefinePlugin as i, Client$5 as it, IfTsDsl as j, NewTsDsl as k, OpenApiParameterObject as l, LazyOrAsync as lt, Logger as m, UserConfig as n, Client$3 as nt, OpenApi as o, Client$7 as ot, Context as p, CallTsDsl as q, Input as r, Client$4 as rt, OpenApiMetaObject as s, StringCase as st, Config as t, Client$2 as tt, OpenApiRequestBodyObject as u, MaybeArray as ut, TypeObjectTsDsl as v, RegExpTsDsl as w, ThrowTsDsl as x, TypeLiteralTsDsl as y, MethodTsDsl as z };
|
|
15677
|
+
//# sourceMappingURL=config-BpulPCv9.d.ts.map
|