bupkis 0.1.2 → 0.3.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.
Files changed (198) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +16 -16
  3. package/dist/commonjs/assertion/assertion-async.d.ts +2 -1
  4. package/dist/commonjs/assertion/assertion-async.d.ts.map +1 -1
  5. package/dist/commonjs/assertion/assertion-async.js +84 -2
  6. package/dist/commonjs/assertion/assertion-async.js.map +1 -1
  7. package/dist/commonjs/assertion/assertion-sync.d.ts +1 -1
  8. package/dist/commonjs/assertion/assertion-sync.d.ts.map +1 -1
  9. package/dist/commonjs/assertion/assertion-sync.js +5 -1
  10. package/dist/commonjs/assertion/assertion-sync.js.map +1 -1
  11. package/dist/commonjs/assertion/assertion-types.d.ts +39 -84
  12. package/dist/commonjs/assertion/assertion-types.d.ts.map +1 -1
  13. package/dist/commonjs/assertion/assertion.d.ts +1 -1
  14. package/dist/commonjs/assertion/assertion.d.ts.map +1 -1
  15. package/dist/commonjs/assertion/assertion.js +1 -14
  16. package/dist/commonjs/assertion/assertion.js.map +1 -1
  17. package/dist/commonjs/assertion/create.d.ts +5 -33
  18. package/dist/commonjs/assertion/create.d.ts.map +1 -1
  19. package/dist/commonjs/assertion/create.js +17 -6
  20. package/dist/commonjs/assertion/create.js.map +1 -1
  21. package/dist/commonjs/assertion/impl/async.d.ts +122 -21
  22. package/dist/commonjs/assertion/impl/async.d.ts.map +1 -1
  23. package/dist/commonjs/assertion/impl/async.js +114 -90
  24. package/dist/commonjs/assertion/impl/async.js.map +1 -1
  25. package/dist/commonjs/assertion/impl/callback.d.ts +104 -0
  26. package/dist/commonjs/assertion/impl/callback.d.ts.map +1 -0
  27. package/dist/commonjs/assertion/impl/callback.js +694 -0
  28. package/dist/commonjs/assertion/impl/callback.js.map +1 -0
  29. package/dist/commonjs/assertion/impl/index.d.ts +1 -1
  30. package/dist/commonjs/assertion/impl/index.d.ts.map +1 -1
  31. package/dist/commonjs/assertion/impl/index.js.map +1 -1
  32. package/dist/commonjs/assertion/impl/sync-esoteric.js +1 -1
  33. package/dist/commonjs/assertion/impl/sync-esoteric.js.map +1 -1
  34. package/dist/commonjs/assertion/impl/sync-parametric.d.ts +37 -34
  35. package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
  36. package/dist/commonjs/assertion/impl/sync-parametric.js +32 -47
  37. package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
  38. package/dist/commonjs/assertion/impl/sync.d.ts +105 -58
  39. package/dist/commonjs/assertion/impl/sync.d.ts.map +1 -1
  40. package/dist/commonjs/assertion/impl/sync.js +4 -1
  41. package/dist/commonjs/assertion/impl/sync.js.map +1 -1
  42. package/dist/commonjs/bootstrap.d.ts +199 -85
  43. package/dist/commonjs/bootstrap.d.ts.map +1 -1
  44. package/dist/commonjs/bootstrap.js +19 -10
  45. package/dist/commonjs/bootstrap.js.map +1 -1
  46. package/dist/commonjs/constant.js +7 -1
  47. package/dist/commonjs/constant.js.map +1 -1
  48. package/dist/commonjs/error.d.ts +32 -5
  49. package/dist/commonjs/error.d.ts.map +1 -1
  50. package/dist/commonjs/error.js +60 -5
  51. package/dist/commonjs/error.js.map +1 -1
  52. package/dist/commonjs/expect.d.ts +130 -3
  53. package/dist/commonjs/expect.d.ts.map +1 -1
  54. package/dist/commonjs/expect.js +116 -1
  55. package/dist/commonjs/expect.js.map +1 -1
  56. package/dist/commonjs/guards.d.ts +45 -20
  57. package/dist/commonjs/guards.d.ts.map +1 -1
  58. package/dist/commonjs/guards.js +56 -40
  59. package/dist/commonjs/guards.js.map +1 -1
  60. package/dist/commonjs/index.d.ts +241 -86
  61. package/dist/commonjs/index.d.ts.map +1 -1
  62. package/dist/commonjs/index.js +44 -42
  63. package/dist/commonjs/index.js.map +1 -1
  64. package/dist/commonjs/metadata.d.ts +1 -27
  65. package/dist/commonjs/metadata.d.ts.map +1 -1
  66. package/dist/commonjs/metadata.js +16 -15
  67. package/dist/commonjs/metadata.js.map +1 -1
  68. package/dist/commonjs/schema.d.ts +76 -33
  69. package/dist/commonjs/schema.d.ts.map +1 -1
  70. package/dist/commonjs/schema.js +77 -34
  71. package/dist/commonjs/schema.js.map +1 -1
  72. package/dist/commonjs/types.d.ts +480 -39
  73. package/dist/commonjs/types.d.ts.map +1 -1
  74. package/dist/commonjs/types.js +12 -2
  75. package/dist/commonjs/types.js.map +1 -1
  76. package/dist/commonjs/util.d.ts +72 -49
  77. package/dist/commonjs/util.d.ts.map +1 -1
  78. package/dist/commonjs/util.js +175 -155
  79. package/dist/commonjs/util.js.map +1 -1
  80. package/dist/commonjs/value-to-schema.d.ts +122 -0
  81. package/dist/commonjs/value-to-schema.d.ts.map +1 -0
  82. package/dist/commonjs/value-to-schema.js +309 -0
  83. package/dist/commonjs/value-to-schema.js.map +1 -0
  84. package/dist/esm/assertion/assertion-async.d.ts +2 -1
  85. package/dist/esm/assertion/assertion-async.d.ts.map +1 -1
  86. package/dist/esm/assertion/assertion-async.js +85 -3
  87. package/dist/esm/assertion/assertion-async.js.map +1 -1
  88. package/dist/esm/assertion/assertion-sync.d.ts +1 -1
  89. package/dist/esm/assertion/assertion-sync.d.ts.map +1 -1
  90. package/dist/esm/assertion/assertion-sync.js +6 -2
  91. package/dist/esm/assertion/assertion-sync.js.map +1 -1
  92. package/dist/esm/assertion/assertion-types.d.ts +39 -84
  93. package/dist/esm/assertion/assertion-types.d.ts.map +1 -1
  94. package/dist/esm/assertion/assertion.d.ts +1 -1
  95. package/dist/esm/assertion/assertion.d.ts.map +1 -1
  96. package/dist/esm/assertion/assertion.js +1 -14
  97. package/dist/esm/assertion/assertion.js.map +1 -1
  98. package/dist/esm/assertion/create.d.ts +5 -33
  99. package/dist/esm/assertion/create.d.ts.map +1 -1
  100. package/dist/esm/assertion/create.js +14 -4
  101. package/dist/esm/assertion/create.js.map +1 -1
  102. package/dist/esm/assertion/impl/async.d.ts +122 -21
  103. package/dist/esm/assertion/impl/async.d.ts.map +1 -1
  104. package/dist/esm/assertion/impl/async.js +113 -89
  105. package/dist/esm/assertion/impl/async.js.map +1 -1
  106. package/dist/esm/assertion/impl/callback.d.ts +104 -0
  107. package/dist/esm/assertion/impl/callback.d.ts.map +1 -0
  108. package/dist/esm/assertion/impl/callback.js +691 -0
  109. package/dist/esm/assertion/impl/callback.js.map +1 -0
  110. package/dist/esm/assertion/impl/index.d.ts +1 -1
  111. package/dist/esm/assertion/impl/index.d.ts.map +1 -1
  112. package/dist/esm/assertion/impl/index.js +1 -1
  113. package/dist/esm/assertion/impl/index.js.map +1 -1
  114. package/dist/esm/assertion/impl/sync-esoteric.js +2 -2
  115. package/dist/esm/assertion/impl/sync-esoteric.js.map +1 -1
  116. package/dist/esm/assertion/impl/sync-parametric.d.ts +37 -34
  117. package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
  118. package/dist/esm/assertion/impl/sync-parametric.js +32 -47
  119. package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
  120. package/dist/esm/assertion/impl/sync.d.ts +105 -58
  121. package/dist/esm/assertion/impl/sync.d.ts.map +1 -1
  122. package/dist/esm/assertion/impl/sync.js +3 -1
  123. package/dist/esm/assertion/impl/sync.js.map +1 -1
  124. package/dist/esm/bootstrap.d.ts +199 -85
  125. package/dist/esm/bootstrap.d.ts.map +1 -1
  126. package/dist/esm/bootstrap.js +19 -10
  127. package/dist/esm/bootstrap.js.map +1 -1
  128. package/dist/esm/constant.js +6 -0
  129. package/dist/esm/constant.js.map +1 -1
  130. package/dist/esm/error.d.ts +32 -5
  131. package/dist/esm/error.d.ts.map +1 -1
  132. package/dist/esm/error.js +59 -5
  133. package/dist/esm/error.js.map +1 -1
  134. package/dist/esm/expect.d.ts +130 -3
  135. package/dist/esm/expect.d.ts.map +1 -1
  136. package/dist/esm/expect.js +117 -2
  137. package/dist/esm/expect.js.map +1 -1
  138. package/dist/esm/guards.d.ts +45 -20
  139. package/dist/esm/guards.d.ts.map +1 -1
  140. package/dist/esm/guards.js +48 -31
  141. package/dist/esm/guards.js.map +1 -1
  142. package/dist/esm/index.d.ts +241 -86
  143. package/dist/esm/index.d.ts.map +1 -1
  144. package/dist/esm/index.js +46 -7
  145. package/dist/esm/index.js.map +1 -1
  146. package/dist/esm/metadata.d.ts +1 -27
  147. package/dist/esm/metadata.d.ts.map +1 -1
  148. package/dist/esm/metadata.js +2 -1
  149. package/dist/esm/metadata.js.map +1 -1
  150. package/dist/esm/schema.d.ts +76 -33
  151. package/dist/esm/schema.d.ts.map +1 -1
  152. package/dist/esm/schema.js +77 -34
  153. package/dist/esm/schema.js.map +1 -1
  154. package/dist/esm/types.d.ts +480 -39
  155. package/dist/esm/types.d.ts.map +1 -1
  156. package/dist/esm/types.js +12 -2
  157. package/dist/esm/types.js.map +1 -1
  158. package/dist/esm/util.d.ts +72 -49
  159. package/dist/esm/util.d.ts.map +1 -1
  160. package/dist/esm/util.js +159 -153
  161. package/dist/esm/util.js.map +1 -1
  162. package/dist/esm/value-to-schema.d.ts +122 -0
  163. package/dist/esm/value-to-schema.d.ts.map +1 -0
  164. package/dist/esm/value-to-schema.js +305 -0
  165. package/dist/esm/value-to-schema.js.map +1 -0
  166. package/package.json +94 -17
  167. package/src/assertion/assertion-async.ts +113 -3
  168. package/src/assertion/assertion-sync.ts +5 -2
  169. package/src/assertion/assertion-types.ts +52 -45
  170. package/src/assertion/assertion.ts +2 -17
  171. package/src/assertion/create.ts +16 -65
  172. package/src/assertion/impl/async.ts +132 -92
  173. package/src/assertion/impl/callback.ts +882 -0
  174. package/src/assertion/impl/index.ts +1 -1
  175. package/src/assertion/impl/sync-esoteric.ts +2 -2
  176. package/src/assertion/impl/sync-parametric.ts +41 -49
  177. package/src/assertion/impl/sync.ts +3 -0
  178. package/src/bootstrap.ts +21 -11
  179. package/src/constant.ts +8 -0
  180. package/src/error.ts +75 -4
  181. package/src/expect.ts +275 -20
  182. package/src/guards.ts +74 -69
  183. package/src/index.ts +72 -11
  184. package/src/metadata.ts +3 -4
  185. package/src/schema.ts +80 -36
  186. package/src/types.ts +625 -72
  187. package/src/util.ts +174 -222
  188. package/src/value-to-schema.ts +464 -0
  189. package/dist/commonjs/api.d.ts +0 -93
  190. package/dist/commonjs/api.d.ts.map +0 -1
  191. package/dist/commonjs/api.js +0 -8
  192. package/dist/commonjs/api.js.map +0 -1
  193. package/dist/esm/api.d.ts +0 -93
  194. package/dist/esm/api.d.ts.map +0 -1
  195. package/dist/esm/api.js +0 -7
  196. package/dist/esm/api.js.map +0 -1
  197. package/src/api.ts +0 -149
  198. package/src/schema.md +0 -15
@@ -1,58 +1,366 @@
1
1
  /**
2
- * Types used throughout _BUPKIS_, mainly related to the
3
- * `expect()`/`expectAsync()` API.
2
+ * Types used throughout _BUPKIS_.
3
+ *
4
+ * May be useful for those building on top of _BUPKIS_.
5
+ *
6
+ * @example
7
+ *
8
+ * ```ts
9
+ * // namespace
10
+ * import { types } from 'bupkis';
11
+ * // subpath import
12
+ * import type * as alsoTypes from 'bupkis/types';
13
+ * ```
4
14
  *
5
15
  * @packageDocumentation
6
16
  */
7
- import type { ArrayValues, NonEmptyTuple, Constructor as TypeFestConstructor } from 'type-fest';
17
+ import type { ArrayValues, TupleToUnion, Constructor as TypeFestConstructor, UnionToIntersection } from 'type-fest';
8
18
  import type { z } from 'zod/v4';
9
- import type { AnyAssertion, AnyAsyncAssertion, AnyAsyncAssertions, AnySyncAssertion, AnySyncAssertions, AssertionPart, AssertionParts, AssertionSlot, NoNeverTuple, PhraseLiteral, PhraseLiteralChoice, PhraseLiteralChoiceSlot, PhraseLiteralSlot } from './assertion/assertion-types.js';
10
- import { type Expect, type ExpectAsync } from './api.js';
19
+ import type { AnyAssertion, AnyAsyncAssertion, AnyAsyncAssertions, AnySyncAssertion, AnySyncAssertions, AssertionFunctionAsync, AssertionFunctionSync, AssertionImplFnAsync, AssertionImplFnSync, AssertionImplSchemaAsync, AssertionImplSchemaSync, AssertionPart, AssertionParts, AssertionSchemaAsync, AssertionSchemaSync, AssertionSlot, AssertionSlots, BuiltinAsyncAssertions, BuiltinSyncAssertions, NoNeverTuple, PhraseLiteral, PhraseLiteralChoice, PhraseLiteralChoiceSlot, PhraseLiteralSlot, RawAssertionImplSchemaSync } from './assertion/assertion-types.js';
11
20
  /**
12
- * Helper type to create negated version of assertion parts. For phrase
13
- * literals, creates "not phrase" version. For phrase arrays, creates negated
14
- * versions of each phrase in the array.
21
+ * Creates a negated version of a tuple of
22
+ * {@link AssertionPart | AssertionParts}.
23
+ *
24
+ * For {@link PhraseLiteral | PhraseLiterals}, creates a
25
+ * {@link Negation | "not" variant}. For
26
+ * {@link PhraseLiteralChoice | PhraseLiteralChoices}, creates negated versions
27
+ * of each `Phrase` in the array.
28
+ *
29
+ * Does not affect Zod schemas.
30
+ *
31
+ * @template Parts Parts containing `PhraseLiterals` or `PhraseLiteralChoices`
32
+ * to negate.
15
33
  */
16
- export type AddNegation<T extends readonly AssertionPart[]> = T extends readonly [
34
+ export type AddNegation<Parts extends readonly AssertionPart[]> = Parts extends readonly [
17
35
  infer First extends AssertionPart,
18
36
  ...infer Rest extends readonly AssertionPart[]
19
- ] ? First extends NonEmptyTuple<string> ? readonly [
37
+ ] ? First extends PhraseLiteralChoice ? readonly [
20
38
  {
21
- [K in keyof First]: First[K] extends string ? Negation<First[K]> : never;
39
+ [K in keyof First]: First[K] extends PhraseLiteral ? Negation<First[K]> : never;
22
40
  },
23
41
  ...AddNegation<Rest>
24
- ] : First extends string ? readonly [Negation<First>, ...AddNegation<Rest>] : readonly [First, ...AddNegation<Rest>] : readonly [];
42
+ ] : First extends PhraseLiteral ? readonly [Negation<First>, ...AddNegation<Rest>] : readonly [First, ...AddNegation<Rest>] : readonly [];
43
+ /**
44
+ * Base set of properties included in both {@link Expect} and {@link ExpectAsync}.
45
+ *
46
+ * @preventExpand
47
+ */
48
+ export interface BaseExpect {
49
+ /**
50
+ * Creates a new synchronous assertion.
51
+ */
52
+ createAssertion: CreateAssertionFn;
53
+ /**
54
+ * Creates a new asynchronous assertion.
55
+ */
56
+ createAsyncAssertion: CreateAsyncAssertionFn;
57
+ /**
58
+ * Fails immediately with optional `reason`.
59
+ *
60
+ * @param reason Reason for failure
61
+ * @throws {AssertionError}
62
+ */
63
+ fail: FailFn;
64
+ }
65
+ export type * from './assertion/assertion-types.js';
66
+ /**
67
+ * The main API as returned by a {@link UseFn}.
68
+ *
69
+ * @template BaseSyncAssertions Base set of synchronous
70
+ * {@link Assertion Assertions}; will be the builtin sync assertions, at
71
+ * minimum)
72
+ * @template BaseAsyncAssertions Base set of asynchronous
73
+ * {@link Assertion Assertions}; will be the builtin async assertions, at
74
+ * minimum)
75
+ * @template ExtendedSyncAssertions Synchronous assertions extracted from
76
+ * `MixedAssertions`
77
+ * @template ExtendedAsyncAssertions Asynchronous assertions extracted from
78
+ * `MixedAssertions`
79
+ */
80
+ export interface Bupkis<BaseSyncAssertions extends AnySyncAssertions, BaseAsyncAssertions extends AnyAsyncAssertions, ExtendedSyncAssertions extends readonly AnySyncAssertion[] = readonly [], ExtendedAsyncAssertions extends readonly AnyAsyncAssertion[] = readonly []> {
81
+ /**
82
+ * A new {@link Expect} function which handles {@link ExtendedSyncAssertions}
83
+ * and {@link BaseSyncAssertions}
84
+ */
85
+ expect: Expect<Concat<BaseSyncAssertions, ExtendedSyncAssertions>, Concat<BaseAsyncAssertions, ExtendedAsyncAssertions>>;
86
+ /**
87
+ * A new {@link ExpectAsync} function which handles
88
+ * {@link ExtendedAsyncAssertions} and {@link BaseAsyncAssertions}
89
+ */
90
+ expectAsync: ExpectAsync<Concat<BaseAsyncAssertions, ExtendedAsyncAssertions>, Concat<BaseSyncAssertions, ExtendedSyncAssertions>>;
91
+ /**
92
+ * For composing arrays of assertions, one after another.
93
+ *
94
+ * The _only_ chainable API in <span class="bupkis">Bupkis</span>.
95
+ *
96
+ * @since 0.1.0
97
+ * @example
98
+ *
99
+ * ```ts
100
+ * const { expect } = use([...someAssertions]).use([...otherAssertions]);
101
+ * ```
102
+ */
103
+ use: UseFn<Concat<BaseSyncAssertions, ExtendedSyncAssertions>, Concat<BaseAsyncAssertions, ExtendedAsyncAssertions>>;
104
+ }
25
105
  /**
26
106
  * Helper type to concatenate two tuples
27
107
  */
28
- export type Concat<A extends readonly unknown[], B extends readonly unknown[]> = readonly [...A, ...B];
108
+ export type Concat<TupleA extends readonly unknown[], TupleB extends readonly unknown[]> = readonly [...TupleA, ...TupleB];
29
109
  /**
30
110
  * A constructor based on {@link TypeFestConstructor type-fest's Constructor}
31
111
  * with a default instance type argument.
32
112
  */
33
- export type Constructor<T = any, Arguments extends unknown[] = any[]> = TypeFestConstructor<T, Arguments>;
34
- export type FilterAsyncAssertions<T extends readonly AnyAssertion[]> = T extends readonly [
35
- infer S extends AnyAssertion,
113
+ export type Constructor<Instance = any, Args extends unknown[] = any[]> = TypeFestConstructor<Instance, Args>;
114
+ /**
115
+ * The main factory function for creating synchronous assertions.
116
+ */
117
+ export interface CreateAssertionFn {
118
+ /**
119
+ * Create a synchronous `Assertion` from {@link AssertionParts parts} and a
120
+ * {@link z.ZodType Zod schema}.
121
+ *
122
+ * @template Parts Parts defining the shape of the assertion, including
123
+ * Phrases and Zod schemas
124
+ * @template Impl Assertion implementation as a Zod schema
125
+ * @template Slots Inferred slots based on the provided `Parts`
126
+ * @returns New `AssertionSchemaSync` object
127
+ */
128
+ <const Parts extends AssertionParts, Impl extends RawAssertionImplSchemaSync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionSchemaSync<Parts, AssertionImplSchemaSync<Parts>, Slots>;
129
+ /**
130
+ * Create a synchronous `Assertion` from {@link AssertionParts parts} and an
131
+ * implementation function.
132
+ *
133
+ * @template Parts Parts defining the shape of the assertion, including
134
+ * Phrases and Zod schemas
135
+ * @template Impl Assertion implementation as a function
136
+ * @template Slots Inferred slots based on the provided `Parts`
137
+ * @returns New `AssertionFunctionSync` object
138
+ */
139
+ <const Parts extends AssertionParts, Impl extends AssertionImplFnSync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionFunctionSync<Parts, Impl, Slots>;
140
+ }
141
+ /**
142
+ * The main factory function for creating asynchronous assertions.
143
+ */
144
+ export interface CreateAsyncAssertionFn {
145
+ /**
146
+ * Create an async `Assertion` from {@link AssertionParts parts} and an
147
+ * {@link z.ZodType Zod schema}.
148
+ *
149
+ * The Zod schema need not be async itself.
150
+ *
151
+ * @template Parts Parts defining the shape of the assertion, including
152
+ * Phrases and Zod schemas
153
+ * @template Impl Assertion implementation as a Zod schema
154
+ * @template Slots Inferred slots based on the provided `Parts`
155
+ * @returns New `AssertionSchemaAsync` object
156
+ */
157
+ <const Parts extends AssertionParts, Impl extends AssertionImplSchemaAsync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionSchemaAsync<Parts, Impl, Slots>;
158
+ /**
159
+ * Create an async `Assertion` from {@link AssertionParts parts} and an
160
+ * implementation function.
161
+ *
162
+ * @template Parts Parts defining the shape of the assertion, including
163
+ * Phrases and Zod schemas
164
+ * @template Impl Assertion implementation as a function
165
+ * @template Slots Inferred slots based on the provided `Parts`
166
+ * @returns New `AssertionFunctionAsync` object
167
+ */
168
+ <const Parts extends AssertionParts, Impl extends AssertionImplFnAsync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionFunctionAsync<Parts, Impl, Slots>;
169
+ }
170
+ /**
171
+ * The main synchronous assertion function.
172
+ *
173
+ * Contains properties in {@link ExpectSyncProps}.
174
+ *
175
+ * @template SyncAssertions All synchronous assertions available
176
+ * @template AsyncAssertions All asynchronous assertions available; for use in
177
+ * {@link ExpectSyncProps.use}
178
+ * @expandType ExpectSyncProps
179
+ * @see {@link expect}
180
+ */
181
+ export type Expect<SyncAssertions extends AnySyncAssertions = BuiltinSyncAssertions, AsyncAssertions extends AnyAsyncAssertions = BuiltinAsyncAssertions> = ExpectFunction<SyncAssertions> & ExpectSyncProps<SyncAssertions, AsyncAssertions>;
182
+ /**
183
+ * The main asynchronous assertion function.
184
+ *
185
+ * Contains properties in {@link ExpectAsyncProps}.
186
+ *
187
+ * @template AsyncAssertions All asynchronous assertions available
188
+ * @template SyncAssertions All synchronous assertions available; for use in
189
+ * {@link ExpectAsyncProps.use}
190
+ * @expandType ExpectAsyncProps
191
+ * @see {@link expectAsync}
192
+ */
193
+ export type ExpectAsync<AsyncAssertions extends AnyAsyncAssertions = BuiltinAsyncAssertions, SyncAssertions extends AnySyncAssertions = BuiltinSyncAssertions> = ExpectAsyncFunction<AsyncAssertions> & ExpectAsyncProps<AsyncAssertions, SyncAssertions>;
194
+ /**
195
+ * The callable function type for asynchronous assertions.
196
+ *
197
+ * This type represents the actual function signature of an async expect
198
+ * function, created by mapping all available assertions to their respective
199
+ * function signatures and combining them using intersection types. Each
200
+ * assertion contributes its own overload to the final function type.
201
+ *
202
+ * The function signatures are derived from the {@link AssertionParts} of each
203
+ * assertion, with parameters that match the expected slots for natural language
204
+ * assertion calls.
205
+ *
206
+ * @example
207
+ *
208
+ * ```typescript
209
+ * // Example function type derived from async assertions
210
+ * const expectAsync: ExpectAsyncFunction<MyAsyncAssertions> = ...;
211
+ * await expectAsync(promise, 'to resolve');
212
+ * await expectAsync(promise, 'to resolve with value satisfying', expectedValue);
213
+ * ```
214
+ *
215
+ * @template T - Array of async assertion objects that define available
216
+ * assertion logic
217
+ * @see {@link ExpectFunction} for the synchronous equivalent
218
+ * @see {@link SlotsFromParts} for how assertion parts are converted to function parameters
219
+ */
220
+ export type ExpectAsyncFunction<T extends AnyAsyncAssertions = BuiltinAsyncAssertions> = UnionToIntersection<TupleToUnion<{
221
+ [K in keyof T]: T[K] extends AnyAsyncAssertion ? (...args: MutableOrReadonly<SlotsFromParts<T[K]['parts']>>) => Promise<void> : never;
222
+ }>>;
223
+ /**
224
+ * Properties available on asynchronous expect functions.
225
+ *
226
+ * This interface defines the additional properties and methods that are
227
+ * attached to async expect functions, extending the base expect functionality
228
+ * with async-specific features. These properties provide access to the
229
+ * underlying assertions and enable function composition through the
230
+ * {@link UseFn | use} method.
231
+ *
232
+ * @example
233
+ *
234
+ * ```typescript
235
+ * const expectAsync: ExpectAsync<MyAsyncAssertions> =
236
+ * createExpectAsyncFunction(assertions);
237
+ *
238
+ * // Access the underlying assertions
239
+ * console.log(expectAsync.assertions.length);
240
+ *
241
+ * // Compose with additional assertions
242
+ * const { expectAsync: enhanced } = expectAsync.use(moreAssertions);
243
+ * ```
244
+ *
245
+ * @template AsyncAssertions - Array of async assertion objects available to
246
+ * this expect function
247
+ * @template SyncAssertions - Array of sync assertion objects available for
248
+ * composition via {@link UseFn | use}
249
+ */
250
+ export interface ExpectAsyncProps<AsyncAssertions extends AnyAsyncAssertions, SyncAssertions extends AnySyncAssertions> extends BaseExpect {
251
+ /**
252
+ * Tuple of all assertions available in this `expect()`.
253
+ *
254
+ * @preventExpand
255
+ */
256
+ assertions: AsyncAssertions;
257
+ /**
258
+ * {@inheritDoc UseFn}
259
+ */
260
+ use: UseFn<SyncAssertions, AsyncAssertions>;
261
+ }
262
+ export type ExpectFunction<SyncAssertions extends AnySyncAssertions = BuiltinSyncAssertions> = UnionToIntersection<TupleToUnion<{
263
+ [K in keyof SyncAssertions]: SyncAssertions[K] extends AnySyncAssertion ? (...args: MutableOrReadonly<SlotsFromParts<SyncAssertions[K]['parts']>>) => void : never;
264
+ }>>;
265
+ /**
266
+ * Properties of {@link expect}.
267
+ */
268
+ export interface ExpectSyncProps<SyncAssertions extends AnySyncAssertions, AsyncAssertions extends AnyAsyncAssertions> extends BaseExpect {
269
+ /**
270
+ * Tuple of all assertions available in this `expect()`.
271
+ *
272
+ * @preventExpand
273
+ */
274
+ assertions: SyncAssertions;
275
+ /**
276
+ * Function to add more assertions to this `expect()`, returning a new
277
+ * `expect()` and `expectAsync()` pair with the combined assertions.
278
+ */
279
+ use: UseFn<SyncAssertions, AsyncAssertions>;
280
+ }
281
+ /**
282
+ * A function which immediately throws an {@link AssertionError}.
283
+ *
284
+ * Member of {@link BaseExpect}.
285
+ *
286
+ * @param reason Optional reason for failure
287
+ * @see {@link fail}
288
+ */
289
+ export type FailFn = (reason?: string) => never;
290
+ /**
291
+ * Given a mixed array of assertions, filters out only the async assertions.
292
+ */
293
+ /**
294
+ * Given a mixed array of assertions, filters out only the async assertions.
295
+ *
296
+ * This utility type recursively examines each assertion in the input array and
297
+ * constructs a new tuple containing only the asynchronous assertions. It uses
298
+ * conditional types to test whether each assertion extends
299
+ * {@link AnyAsyncAssertion} and includes it in the result if so.
300
+ *
301
+ * Used primarily by {@link UseFn} to separate async assertions from mixed
302
+ * assertion arrays when composing expect functions.
303
+ *
304
+ * @example
305
+ *
306
+ * ```typescript
307
+ * type Mixed = [
308
+ * SyncAssertion1,
309
+ * AsyncAssertion1,
310
+ * SyncAssertion2,
311
+ * AsyncAssertion2,
312
+ * ];
313
+ * type AsyncOnly = FilterAsyncAssertions<Mixed>; // [AsyncAssertion1, AsyncAssertion2]
314
+ * ```
315
+ *
316
+ * @template MixedAssertions - Array that may contain both sync and async
317
+ * assertions
318
+ * @see {@link FilterSyncAssertions} for extracting synchronous assertions
319
+ * @see {@link UseFn} for the primary use case of this type
320
+ */
321
+ export type FilterAsyncAssertions<MixedAssertions extends readonly AnyAssertion[]> = MixedAssertions extends readonly [
322
+ infer MixedAssertion extends AnyAssertion,
36
323
  ...infer Rest extends readonly AnyAssertion[]
37
- ] ? S extends AnyAsyncAssertion ? readonly [S, ...FilterAsyncAssertions<Rest>] : FilterAsyncAssertions<Rest> : readonly [];
38
- export type FilterSyncAssertions<T extends readonly AnyAssertion[]> = T extends readonly [
39
- infer S extends AnyAssertion,
324
+ ] ? MixedAssertion extends AnyAsyncAssertion ? readonly [MixedAssertion, ...FilterAsyncAssertions<Rest>] : FilterAsyncAssertions<Rest> : readonly [];
325
+ /**
326
+ * Given a mixed array of assertions, extracts only the synchronous assertions.
327
+ */
328
+ export type FilterSyncAssertions<MixedAssertions extends readonly AnyAssertion[]> = MixedAssertions extends readonly [
329
+ infer MixedAssertion extends AnyAssertion,
40
330
  ...infer Rest extends readonly AnyAssertion[]
41
- ] ? S extends AnySyncAssertion ? readonly [S, ...FilterSyncAssertions<Rest>] : FilterSyncAssertions<Rest> : readonly [];
331
+ ] ? MixedAssertion extends AnySyncAssertion ? readonly [MixedAssertion, ...FilterSyncAssertions<Rest>] : FilterSyncAssertions<Rest> : readonly [];
42
332
  /**
43
- * Prepares {@link MapExpectSlots} by injecting `unknown` if the `AssertionParts`
44
- * have no `z.ZodType` in the head position.
333
+ * Maps AssertionParts to the corresponding argument types for expect and
334
+ * expectAsync functions.
45
335
  *
46
- * Also filters out `never` from the resulting tuple to guarantee tupleness.
336
+ * This utility type transforms assertion parts into the actual parameter types
337
+ * that users provide when calling expect functions. It handles both phrase
338
+ * literals and Zod schemas, creating appropriate TypeScript types for each
339
+ * slot.
340
+ *
341
+ * For phrase literals, it creates union types that include both the original
342
+ * phrase and its negated version (with "not " prefix). For Zod schemas, it
343
+ * extracts the inferred type. This enables natural language assertions with
344
+ * optional negation support.
47
345
  *
48
346
  * @remarks
49
- * This is a convenience and I hope it's not too confusing.
50
- */
51
- export type InferredExpectSlots<Parts extends AssertionParts> = NoNeverTuple<Parts extends readonly [infer First extends AssertionPart, ...infer _] ? First extends PhraseLiteral | PhraseLiteralChoice ? [unknown, ...MapExpectSlots<Parts>] : MapExpectSlots<Parts> : never>; /**
52
- * Maps `AssertionParts` to the corresponding argument types for `expect` and
53
- * `expectAsync`, as provided by the user.
347
+ * This type works recursively through the parts tuple, transforming each part
348
+ * according to its type. The resulting tuple maintains the same structure as
349
+ * the input but with user-facing TypeScript types instead of internal assertion
350
+ * part types.
351
+ * @example
352
+ *
353
+ * ```typescript
354
+ * // Given parts: ['to be a', z.string()]
355
+ * // Results in: ['to be a' | 'not to be a', string]
356
+ * type Slots = MapExpectSlots<['to be a', z.string()]>;
357
+ * // Usage: expect(value, 'to be a', 'hello') or expect(value, 'not to be a', 'hello')
358
+ * ```
54
359
  *
55
- * Overloads each phrase literal slot with a negated version using a union.
360
+ * @template Parts - Tuple of assertion parts to be converted to function
361
+ * parameter types
362
+ * @see {@link SlotsFromParts} for the complete slot transformation including subject injection
363
+ * @see {@link Negation} for how phrase negation is implemented
56
364
  */
57
365
  export type MapExpectSlots<Parts extends readonly AssertionPart[]> = Parts extends readonly [
58
366
  infer First extends AssertionPart,
@@ -62,18 +370,151 @@ export type MapExpectSlots<Parts extends readonly AssertionPart[]> = Parts exten
62
370
  ...MapExpectSlots<Rest>
63
371
  ] : readonly [];
64
372
  /**
65
- * Makes tuple types accept both mutable and readonly variants
373
+ * Makes tuple types accept both mutable and readonly variants.
374
+ *
375
+ * This utility type creates a union of both mutable and readonly versions of a
376
+ * tuple type, providing flexibility for function parameters that should accept
377
+ * either variant. This is particularly useful for assertion function parameters
378
+ * where users may pass either `const` arrays (readonly) or regular arrays.
379
+ *
380
+ * The type handles both array types and specific tuple types, creating
381
+ * appropriate unions for each case to maintain type safety while maximizing
382
+ * usability.
383
+ *
384
+ * @example
385
+ *
386
+ * ```typescript
387
+ * type FlexibleArgs = MutableOrReadonly<readonly [string, number]>;
388
+ * // Results in: [string, number] | readonly [string, number]
389
+ *
390
+ * function acceptArgs(args: FlexibleArgs) { ... }
391
+ * acceptArgs(['hello', 42]); // ✓ mutable array
392
+ * acceptArgs(['hello', 42] as const); // ✓ readonly array
393
+ * ```
394
+ *
395
+ * @template Tuple - The readonly tuple type to make flexible
396
+ * @see {@link ExpectFunction} and {@link ExpectAsyncFunction} which use this for parameter flexibility
397
+ */
398
+ export type MutableOrReadonly<Tuple extends readonly unknown[]> = Tuple extends readonly (infer Item)[] ? Item[] | readonly Item[] : Tuple extends readonly [infer First, ...infer Rest] ? [First, ...Rest] | readonly [First, ...Rest] : Tuple;
399
+ /**
400
+ * Creates a negated version of a phrase literal by prefixing "not ".
401
+ *
402
+ * This utility type transforms assertion phrases into their negated
403
+ * equivalents, enabling the natural language negation feature in Bupkis
404
+ * assertions. When users provide phrases like "not to be a string", this type
405
+ * helps the system understand and process the negation.
406
+ *
407
+ * The negation is applied at the type level during assertion matching and
408
+ * affects how the assertion logic is executed - negated assertions expect the
409
+ * opposite result.
410
+ *
411
+ * @example
412
+ *
413
+ * ```typescript
414
+ * type Negated = Negation<'to be a string'>; // "not to be a string"
415
+ * type AlsoNegated = Negation<'to equal'>; // "not to equal"
416
+ *
417
+ * // Usage in assertions:
418
+ * expect(42, 'not to be a string'); // Uses negated assertion logic
419
+ * ```
420
+ *
421
+ * @template S - The string literal phrase to be negated
422
+ * @see {@link AddNegation} for applying negation to entire AssertionParts tuples
423
+ * @see {@link MapExpectSlots} for how negation is incorporated into function signatures
66
424
  */
67
- export type MutableOrReadonly<T> = T extends readonly (infer U)[] ? readonly U[] | U[] : T extends readonly [infer First, ...infer Rest] ? [First, ...Rest] | readonly [First, ...Rest] : T;
425
+ export type Negation<S extends string> = `not ${S}`;
68
426
  /**
69
- * The type of a `PhraesLiteral` which is negated, e.g. "not to be"
427
+ * Converts AssertionParts to complete function parameter types for expect
428
+ * functions.
429
+ *
430
+ * This utility type prepares assertion parts for use as function parameters by
431
+ * applying several transformations:
432
+ *
433
+ * 1. Injects an `unknown` type for the subject parameter if the first part is a
434
+ * phrase literal
435
+ * 2. Maps the remaining parts to their corresponding TypeScript types via
436
+ * {@link MapExpectSlots}
437
+ * 3. Filters out `never` types to ensure a clean tuple structure
438
+ *
439
+ * The subject injection is a key feature - when assertions start with phrases
440
+ * like "to be a string", users still need to provide the subject being tested
441
+ * as the first argument to expect functions.
442
+ *
443
+ * @remarks
444
+ * This type is essential for bridging the gap between assertion definitions and
445
+ * user-facing function signatures. The subject injection ensures that all
446
+ * assertions have a consistent calling pattern regardless of whether they
447
+ * explicitly define a subject parameter.
448
+ * @example
449
+ *
450
+ * ```typescript
451
+ * // Assertion parts: ['to equal', z.string()]
452
+ * // Results in: [unknown, 'to equal' | 'not to equal', string]
453
+ * type Slots = SlotsFromParts<['to equal', z.string()]>;
454
+ *
455
+ * // Usage: expect(subject, 'to equal', 'expected')
456
+ * // expect(subject, 'not to equal', 'unexpected')
457
+ * ```
458
+ *
459
+ * @template Parts - Tuple of assertion parts that define the assertion
460
+ * structure
461
+ * @see {@link MapExpectSlots} for the core slot mapping logic
462
+ * @see {@link NoNeverTuple} for never-type filtering
463
+ */
464
+ export type SlotsFromParts<Parts extends AssertionParts> = NoNeverTuple<Parts extends readonly [infer First extends AssertionPart, ...infer _] ? First extends PhraseLiteral | PhraseLiteralChoice ? [unknown, ...MapExpectSlots<Parts>] : MapExpectSlots<Parts> : never>;
465
+ /**
466
+ * The type of a `use()` function.
467
+ */
468
+ export interface UseFn<BaseSyncAssertions extends AnySyncAssertions, BaseAsyncAssertions extends AnyAsyncAssertions> {
469
+ /**
470
+ * @template MixedAssertions Mixed set of assertions to add; may include both
471
+ * sync and async assertions
472
+ * @template ExtendedSyncAssertions Synchronous assertions extracted from
473
+ * `MixedAssertions`
474
+ * @template ExtendedAsyncAssertions Asynchronous assertions extracted from
475
+ * `MixedAssertions`
476
+ * @param assertions Array of assertion classes to add
477
+ * @returns New {@link expect} and {@link expectAsync} functions with the
478
+ * combined assertions
479
+ */
480
+ <MixedAssertions extends readonly AnyAssertion[], ExtendedSyncAssertions extends FilterSyncAssertions<MixedAssertions>, ExtendedAsyncAssertions extends FilterAsyncAssertions<MixedAssertions>>(assertions: MixedAssertions): Bupkis<BaseSyncAssertions, BaseAsyncAssertions, ExtendedSyncAssertions, ExtendedAsyncAssertions>;
481
+ }
482
+ /**
483
+ * Maps Zod `def.type` strings to their corresponding ZodType classes.
484
+ *
485
+ * This allows for type-safe discrimination of ZodTypes based on their internal
486
+ * `def.type` property in Zod v4.
70
487
  */
71
- export type Negation<T extends string> = `not ${T}`;
72
- export interface UseFn<T extends AnySyncAssertions, U extends AnyAsyncAssertions> {
73
- <V extends readonly AnyAssertion[], W extends FilterSyncAssertions<V>, X extends FilterAsyncAssertions<V>>(assertions: V): {
74
- expect: Expect<Concat<T, W>, Concat<U, X>>;
75
- expectAsync: ExpectAsync<Concat<U, X>, Concat<T, W>>;
76
- use: UseFn<Concat<T, W>, Concat<U, X>>;
77
- };
488
+ export interface ZodTypeMap {
489
+ any: z.ZodAny;
490
+ array: z.ZodArray<any>;
491
+ bigint: z.ZodBigInt;
492
+ boolean: z.ZodBoolean;
493
+ catch: z.ZodCatch<any>;
494
+ date: z.ZodDate;
495
+ default: z.ZodDefault<any>;
496
+ enum: z.ZodEnum<any>;
497
+ function: z.ZodFunction<any, any>;
498
+ lazy: z.ZodLazy<any>;
499
+ literal: z.ZodLiteral<any>;
500
+ map: z.ZodMap<any, any>;
501
+ never: z.ZodNever;
502
+ null: z.ZodNull;
503
+ nullable: z.ZodNullable<any>;
504
+ number: z.ZodNumber;
505
+ object: z.ZodObject<any>;
506
+ optional: z.ZodOptional<any>;
507
+ pipe: z.ZodPipe<any, any>;
508
+ promise: z.ZodPromise<any>;
509
+ readonly: z.ZodReadonly<any>;
510
+ record: z.ZodRecord<any, any>;
511
+ set: z.ZodSet<any>;
512
+ string: z.ZodString;
513
+ symbol: z.ZodSymbol;
514
+ tuple: z.ZodTuple<any>;
515
+ undefined: z.ZodUndefined;
516
+ union: z.ZodUnion<any>;
517
+ unknown: z.ZodUnknown;
518
+ void: z.ZodVoid;
78
519
  }
79
520
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,IAAI,mBAAmB,EACnC,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,u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
3
+ *
4
+ * May be useful for those building on top of _BUPKIS_.
5
+ *
6
+ * @example
7
+ *
8
+ * ```ts
9
+ * // namespace
10
+ * import { types } from 'bupkis';
11
+ * // subpath import
12
+ * import type * as alsoTypes from 'bupkis/types';
13
+ * ```
4
14
  *
5
15
  * @packageDocumentation
6
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}