Skip to content

Commit 41dba10

Browse files
chore: rename _types to '~types' (#6133)
1 parent 6b11401 commit 41dba10

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

packages/start-client-core/src/createMiddleware.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export interface FunctionMiddlewareWithTypes<
108108
TClientContext,
109109
TClientSendContext,
110110
> {
111-
_types: FunctionMiddlewareTypes<
111+
'~types': FunctionMiddlewareTypes<
112112
TRegister,
113113
TMiddlewares,
114114
TInputValidator,
@@ -187,9 +187,9 @@ export type IntersectAllValidatorInputs<TMiddlewares, TInputValidator> =
187187
export type IntersectAllMiddleware<
188188
TMiddlewares,
189189
TType extends
190-
| keyof AnyFunctionMiddleware['_types']
191-
| keyof AnyRequestMiddleware['_types']
192-
| keyof AnyServerFn['_types'],
190+
| keyof AnyFunctionMiddleware['~types']
191+
| keyof AnyRequestMiddleware['~types']
192+
| keyof AnyServerFn['~types'],
193193
TAcc = undefined,
194194
> = TMiddlewares extends readonly [infer TMiddleware, ...infer TRest]
195195
? TMiddleware extends
@@ -201,7 +201,7 @@ export type IntersectAllMiddleware<
201201
TType,
202202
IntersectAssign<
203203
TAcc,
204-
TMiddleware['_types'][TType & keyof TMiddleware['_types']]
204+
TMiddleware['~types'][TType & keyof TMiddleware['~types']]
205205
>
206206
>
207207
: TAcc
@@ -246,9 +246,9 @@ export type AssignAllClientContextBeforeNext<
246246
export type AssignAllMiddleware<
247247
TMiddlewares,
248248
TType extends
249-
| keyof AnyFunctionMiddleware['_types']
250-
| keyof AnyRequestMiddleware['_types']
251-
| keyof AnyServerFn['_types'],
249+
| keyof AnyFunctionMiddleware['~types']
250+
| keyof AnyRequestMiddleware['~types']
251+
| keyof AnyServerFn['~types'],
252252
TAcc = undefined,
253253
> = TMiddlewares extends readonly [infer TMiddleware, ...infer TRest]
254254
? TMiddleware extends
@@ -258,7 +258,7 @@ export type AssignAllMiddleware<
258258
? AssignAllMiddleware<
259259
TRest,
260260
TType,
261-
Assign<TAcc, TMiddleware['_types'][TType & keyof TMiddleware['_types']]>
261+
Assign<TAcc, TMiddleware['~types'][TType & keyof TMiddleware['~types']]>
262262
>
263263
: TAcc
264264
: TAcc
@@ -480,7 +480,7 @@ export type FunctionServerResultWithContext<
480480
in out TSendContext,
481481
> = {
482482
'use functions must return the result of next()': true
483-
_types: {
483+
'~types': {
484484
context: TServerContext
485485
sendContext: TSendContext
486486
}
@@ -703,7 +703,7 @@ export interface RequestMiddlewareWithTypes<
703703
TMiddlewares,
704704
TServerContext,
705705
> {
706-
_types: RequestMiddlewareTypes<TRegister, TMiddlewares, TServerContext>
706+
'~types': RequestMiddlewareTypes<TRegister, TMiddlewares, TServerContext>
707707
options: RequestMiddlewareOptions<TRegister, TMiddlewares, TServerContext>
708708
}
709709

packages/start-client-core/src/createServerFn.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ export interface ServerFnWithTypes<
536536
in out TInputValidator,
537537
in out TResponse,
538538
> {
539-
_types: ServerFnTypes<
539+
'~types': ServerFnTypes<
540540
TRegister,
541541
TMethod,
542542
TMiddlewares,
@@ -690,7 +690,7 @@ function serverFnBaseToMiddleware(
690690
options: ServerFnBaseOptions<any, any, any, any, any>,
691691
): AnyFunctionMiddleware {
692692
return {
693-
_types: undefined!,
693+
'~types': undefined!,
694694
options: {
695695
inputValidator: options.inputValidator,
696696
client: async ({ next, sendContext, ...ctx }) => {

packages/start-client-core/src/tests/createServerMiddleware.test-d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test('createMiddleware merges server context', () => {
5656

5757
expectTypeOf(result).toEqualTypeOf<{
5858
'use functions must return the result of next()': true
59-
_types: {
59+
'~types': {
6060
context: {
6161
a: boolean
6262
}
@@ -80,7 +80,7 @@ test('createMiddleware merges server context', () => {
8080

8181
expectTypeOf(result).toEqualTypeOf<{
8282
'use functions must return the result of next()': true
83-
_types: {
83+
'~types': {
8484
context: {
8585
b: string
8686
}
@@ -103,7 +103,7 @@ test('createMiddleware merges server context', () => {
103103

104104
expectTypeOf(result).toEqualTypeOf<{
105105
'use functions must return the result of next()': true
106-
_types: {
106+
'~types': {
107107
context: {
108108
c: number
109109
}
@@ -129,7 +129,7 @@ test('createMiddleware merges server context', () => {
129129

130130
expectTypeOf(result).toEqualTypeOf<{
131131
'use functions must return the result of next()': true
132-
_types: {
132+
'~types': {
133133
context: {
134134
d: number
135135
}
@@ -236,7 +236,7 @@ test('createMiddleware merges client context and sends to the server', () => {
236236

237237
expectTypeOf(result).toEqualTypeOf<{
238238
'use functions must return the result of next()': true
239-
_types: {
239+
'~types': {
240240
context: {
241241
e: string
242242
}
@@ -314,7 +314,7 @@ test('createMiddleware merges server context and client context, sends server co
314314

315315
expectTypeOf(result).toEqualTypeOf<{
316316
'use functions must return the result of next()': true
317-
_types: {
317+
'~types': {
318318
context: {
319319
fromServer1: string
320320
}
@@ -353,7 +353,7 @@ test('createMiddleware merges server context and client context, sends server co
353353

354354
expectTypeOf(result).toEqualTypeOf<{
355355
'use functions must return the result of next()': true
356-
_types: {
356+
'~types': {
357357
context: {
358358
fromServer2: string
359359
}
@@ -403,7 +403,7 @@ test('createMiddleware merges server context and client context, sends server co
403403

404404
expectTypeOf(result).toEqualTypeOf<{
405405
'use functions must return the result of next()': true
406-
_types: {
406+
'~types': {
407407
context: {
408408
fromServer3: string
409409
}
@@ -463,7 +463,7 @@ test('createMiddleware merges server context and client context, sends server co
463463

464464
expectTypeOf(result).toEqualTypeOf<{
465465
'use functions must return the result of next()': true
466-
_types: {
466+
'~types': {
467467
context: {
468468
fromServer4: string
469469
}
@@ -532,7 +532,7 @@ test('createMiddleware merges server context and client context, sends server co
532532

533533
expectTypeOf(result).toEqualTypeOf<{
534534
'use functions must return the result of next()': true
535-
_types: {
535+
'~types': {
536536
context: {
537537
fromServer5: string
538538
}

0 commit comments

Comments
 (0)