@effect/platform
Advanced tools
Comparing version 0.15.0 to 0.15.1
@@ -43,6 +43,2 @@ /** | ||
type ExcludeProvided<A> = Exclude<A, RouteContext | ServerRequest.ServerRequest>; | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
type WithoutProvided<R, E> = Router<ExcludeProvided<R>, E>; | ||
} | ||
@@ -162,4 +158,4 @@ /** | ||
export declare const mountApp: { | ||
<R1, E1>(path: string, that: App.Default<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, that: App.Default<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, that: App.Default<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, that: App.Default<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -171,4 +167,4 @@ /** | ||
export declare const route: (method: Method.Method | "*") => { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -180,4 +176,4 @@ /** | ||
export declare const all: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -189,4 +185,4 @@ /** | ||
export declare const get: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -198,4 +194,4 @@ /** | ||
export declare const post: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -207,4 +203,4 @@ /** | ||
export declare const patch: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -216,4 +212,4 @@ /** | ||
export declare const put: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -225,4 +221,4 @@ /** | ||
export declare const del: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -234,4 +230,4 @@ /** | ||
export declare const head: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -243,4 +239,4 @@ /** | ||
export declare const options: { | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router.WithoutProvided<R | R1, E | E1>; | ||
<R1, E1>(path: string, handler: Route.Handler<R1, E1>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, handler: Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
@@ -252,4 +248,4 @@ /** | ||
export declare const use: { | ||
<R, E, R1, E1>(f: (self: Route.Handler<R, E>) => App.Default<R1, E1>): (self: Router<R, E>) => Router.WithoutProvided<R1, E1>; | ||
<R, E, R1, E1>(self: Router<R, E>, f: (self: Route.Handler<R, E>) => App.Default<R1, E1>): Router.WithoutProvided<R1, E1>; | ||
<R, E, R1, E1>(f: (self: Route.Handler<R, E>) => App.Default<R1, E1>): (self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E1>; | ||
<R, E, R1, E1>(self: Router<R, E>, f: (self: Route.Handler<R, E>) => App.Default<R1, E1>): Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E1>; | ||
}; | ||
@@ -261,4 +257,4 @@ /** | ||
export declare const catchAll: { | ||
<E, R2, E2>(f: (e: E) => Route.Handler<R2, E2>): <R>(self: Router<R, E>) => Router.WithoutProvided<R2 | R, E2>; | ||
<R, E, R2, E2>(self: Router<R, E>, f: (e: E) => Route.Handler<R2, E2>): Router.WithoutProvided<R | R2, E2>; | ||
<E, R2, E2>(f: (e: E) => Route.Handler<R2, E2>): <R>(self: Router<R, E>) => Router<Exclude<R2, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E2>; | ||
<R, E, R2, E2>(self: Router<R, E>, f: (e: E) => Route.Handler<R2, E2>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R2, RouteContext | ServerRequest.ServerRequest>, E2>; | ||
}; | ||
@@ -270,4 +266,4 @@ /** | ||
export declare const catchAllCause: { | ||
<E, R2, E2>(f: (e: Cause.Cause<E>) => Route.Handler<R2, E2>): <R>(self: Router<R, E>) => Router.WithoutProvided<R2 | R, E2>; | ||
<R, E, R2, E2>(self: Router<R, E>, f: (e: Cause.Cause<E>) => Route.Handler<R2, E2>): Router.WithoutProvided<R | R2, E2>; | ||
<E, R2, E2>(f: (e: Cause.Cause<E>) => Route.Handler<R2, E2>): <R>(self: Router<R, E>) => Router<Exclude<R2, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E2>; | ||
<R, E, R2, E2>(self: Router<R, E>, f: (e: Cause.Cause<E>) => Route.Handler<R2, E2>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R2, RouteContext | ServerRequest.ServerRequest>, E2>; | ||
}; | ||
@@ -283,3 +279,3 @@ /** | ||
_tag: K; | ||
}>) => Route.Handler<R1, E1>): <R>(self: Router<R, E>) => Router<R1 | R, E1 | Exclude<E, { | ||
}>) => Route.Handler<R1, E1>): <R>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, E1 | Exclude<E, { | ||
_tag: K; | ||
@@ -291,3 +287,3 @@ }>>; | ||
_tag: K; | ||
}>) => Route.Handler<R1, E1>): Router<R | R1, E1 | Exclude<E, { | ||
}>) => Route.Handler<R1, E1>): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E1 | Exclude<E, { | ||
_tag: K; | ||
@@ -306,6 +302,6 @@ }>>; | ||
_tag: K; | ||
}>) => Route.Handler<any, any>) | undefined; | ||
} : {}>(cases: Cases): <R>(self: Router<R, E>) => Router.WithoutProvided<R | { | ||
}>) => Route.Handler<any, any>); | ||
} : {}>(cases: Cases): <R>(self: Router<R, E>) => Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<{ | ||
[K in keyof Cases]: Cases[K] extends (...args: Array<any>) => Effect.Effect<infer R, any, any> ? R : never; | ||
}[keyof Cases], Exclude<E, { | ||
}[keyof Cases], RouteContext | ServerRequest.ServerRequest>, Exclude<E, { | ||
_tag: keyof Cases; | ||
@@ -320,6 +316,6 @@ }> | { | ||
_tag: K; | ||
}>) => Route.Handler<any, any>) | undefined; | ||
} : {}>(self: Router<R, E>, cases: Cases): Router.WithoutProvided<R | { | ||
}>) => Route.Handler<any, any>); | ||
} : {}>(self: Router<R, E>, cases: Cases): Router<Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<{ | ||
[K in keyof Cases]: Cases[K] extends (...args: Array<any>) => Effect.Effect<infer R, any, any> ? R : never; | ||
}[keyof Cases], Exclude<E, { | ||
}[keyof Cases], RouteContext | ServerRequest.ServerRequest>, Exclude<E, { | ||
_tag: keyof Cases; | ||
@@ -335,4 +331,4 @@ }> | { | ||
export declare const provideService: { | ||
<T extends Context.Tag<any, any>>(tag: T, service: Context.Tag.Service<T>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E>; | ||
<R, E, T extends Context.Tag<any, any>>(self: Router<R, E>, tag: T, service: Context.Tag.Service<T>): Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E>; | ||
<T extends Context.Tag<any, any>>(tag: T, service: Context.Tag.Service<T>): <R, E>(self: Router<R, E>) => Router<Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, E>; | ||
<R, E, T extends Context.Tag<any, any>>(self: Router<R, E>, tag: T, service: Context.Tag.Service<T>): Router<Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, E>; | ||
}; | ||
@@ -344,5 +340,5 @@ /** | ||
export declare const provideServiceEffect: { | ||
<T extends Context.Tag<any, any>, R1, E1>(tag: T, effect: Effect.Effect<R1, E1, Context.Tag.Service<T>>): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | Exclude<R, Context.Tag.Identifier<T>>, E1 | E>; | ||
<R, E, T extends Context.Tag<any, any>, R1, E1>(self: Router<R, E>, tag: T, effect: Effect.Effect<R1, E1, Context.Tag.Service<T>>): Router.WithoutProvided<R1 | Exclude<R, Context.Tag.Identifier<T>>, E | E1>; | ||
<T extends Context.Tag<any, any>, R1, E1>(tag: T, effect: Effect.Effect<R1, E1, Context.Tag.Service<T>>): <R, E>(self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, E1 | E>; | ||
<R, E, T extends Context.Tag<any, any>, R1, E1>(self: Router<R, E>, tag: T, effect: Effect.Effect<R1, E1, Context.Tag.Service<T>>): Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, E | E1>; | ||
}; | ||
//# sourceMappingURL=Router.d.ts.map |
import * as Context from "@effect/data/Context"; | ||
import type * as Router from "@effect/platform/Http/Router"; | ||
export declare const provideService: (<T extends Context.Tag<any, any>>(tag: T, service: Context.Tag.Service<T>) => <R, E>(self: Router.Router<R, E>) => Router.Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E>) & (<R_1, E_1, T_1 extends Context.Tag<any, any>>(self: Router.Router<R_1, E_1>, tag: T_1, service: Context.Tag.Service<T_1>) => Router.Router.WithoutProvided<Exclude<R_1, Context.Tag.Identifier<T_1>>, E_1>); | ||
import * as ServerRequest from "@effect/platform/Http/ServerRequest"; | ||
export declare const provideService: (<T extends Context.Tag<any, any>>(tag: T, service: Context.Tag.Service<T>) => <R, E>(self: Router.Router<R, E>) => Router.Router<Exclude<Exclude<R, Context.Tag.Identifier<T>>, ServerRequest.ServerRequest | Router.RouteContext>, E>) & (<R_1, E_1, T_1 extends Context.Tag<any, any>>(self: Router.Router<R_1, E_1>, tag: T_1, service: Context.Tag.Service<T_1>) => Router.Router<Exclude<Exclude<R_1, Context.Tag.Identifier<T_1>>, ServerRequest.ServerRequest | Router.RouteContext>, E_1>); | ||
//# sourceMappingURL=router.d.ts.map |
{ | ||
"name": "@effect/platform", | ||
"version": "0.15.0", | ||
"version": "0.15.1", | ||
"description": "Unified interfaces for common platform-specific services", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -48,7 +48,2 @@ /** | ||
export type ExcludeProvided<A> = Exclude<A, RouteContext | ServerRequest.ServerRequest> | ||
/** | ||
* @since 1.0.0 | ||
*/ | ||
export type WithoutProvided<R, E> = Router<ExcludeProvided<R>, E> | ||
} | ||
@@ -214,4 +209,16 @@ | ||
that: App.Default<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
<R, E, R1, E1>(self: Router<R, E>, path: string, that: App.Default<R1, E1>): Router.WithoutProvided<R | R1, E | E1> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
self: Router<R, E>, | ||
path: string, | ||
that: App.Default<R1, E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.mountApp | ||
@@ -229,3 +236,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -235,3 +247,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.route | ||
@@ -247,3 +262,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -253,3 +273,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.all | ||
@@ -265,3 +288,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -271,3 +299,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.get | ||
@@ -283,3 +314,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -289,3 +325,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.post | ||
@@ -301,3 +340,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -307,3 +351,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.patch | ||
@@ -319,3 +366,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -325,3 +377,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.put | ||
@@ -337,3 +392,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -343,3 +403,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.del | ||
@@ -355,3 +418,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -361,3 +429,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.head | ||
@@ -373,3 +444,8 @@ | ||
handler: Route.Handler<R1, E1> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | R, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, R1, E1>( | ||
@@ -379,3 +455,6 @@ self: Router<R, E>, | ||
handler: Route.Handler<R1, E1> | ||
): Router.WithoutProvided<R | R1, E | E1> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.options | ||
@@ -390,7 +469,7 @@ | ||
f: (self: Route.Handler<R, E>) => App.Default<R1, E1> | ||
): (self: Router<R, E>) => Router.WithoutProvided<R1, E1> | ||
): (self: Router<R, E>) => Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E1> | ||
<R, E, R1, E1>( | ||
self: Router<R, E>, | ||
f: (self: Route.Handler<R, E>) => App.Default<R1, E1> | ||
): Router.WithoutProvided<R1, E1> | ||
): Router<Exclude<R1, RouteContext | ServerRequest.ServerRequest>, E1> | ||
} = internal.use | ||
@@ -403,4 +482,17 @@ | ||
export const catchAll: { | ||
<E, R2, E2>(f: (e: E) => Route.Handler<R2, E2>): <R>(self: Router<R, E>) => Router.WithoutProvided<R2 | R, E2> | ||
<R, E, R2, E2>(self: Router<R, E>, f: (e: E) => Route.Handler<R2, E2>): Router.WithoutProvided<R | R2, E2> | ||
<E, R2, E2>( | ||
f: (e: E) => Route.Handler<R2, E2> | ||
): <R>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R2, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E2 | ||
> | ||
<R, E, R2, E2>( | ||
self: Router<R, E>, | ||
f: (e: E) => Route.Handler<R2, E2> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R2, RouteContext | ServerRequest.ServerRequest>, | ||
E2 | ||
> | ||
} = internal.catchAll | ||
@@ -415,7 +507,15 @@ | ||
f: (e: Cause.Cause<E>) => Route.Handler<R2, E2> | ||
): <R>(self: Router<R, E>) => Router.WithoutProvided<R2 | R, E2> | ||
): <R>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R2, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E2 | ||
> | ||
<R, E, R2, E2>( | ||
self: Router<R, E>, | ||
f: (e: Cause.Cause<E>) => Route.Handler<R2, E2> | ||
): Router.WithoutProvided<R | R2, E2> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R2, RouteContext | ServerRequest.ServerRequest>, | ||
E2 | ||
> | ||
} = internal.catchAllCause | ||
@@ -431,3 +531,8 @@ | ||
f: (e: Extract<E, { _tag: K }>) => Route.Handler<R1, E1> | ||
): <R>(self: Router<R, E>) => Router<R1 | R, E1 | Exclude<E, { _tag: K }>> | ||
): <R>( | ||
self: Router<R, E> | ||
) => Router< | ||
Exclude<R1, RouteContext | ServerRequest.ServerRequest> | Exclude<R, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | Exclude<E, { _tag: K }> | ||
> | ||
<R, E, K extends E extends { _tag: string } ? E["_tag"] : never, R1, E1>( | ||
@@ -437,3 +542,6 @@ self: Router<R, E>, | ||
f: (e: Extract<E, { _tag: K }>) => Route.Handler<R1, E1> | ||
): Router<R | R1, E1 | Exclude<E, { _tag: K }>> | ||
): Router< | ||
Exclude<R, RouteContext | ServerRequest.ServerRequest> | Exclude<R1, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | Exclude<E, { _tag: K }> | ||
> | ||
} = internal.catchTag | ||
@@ -449,3 +557,3 @@ | ||
Cases extends E extends { _tag: string } | ||
? { [K in E["_tag"]]+?: ((error: Extract<E, { _tag: K }>) => Route.Handler<any, any>) | undefined } | ||
? { [K in E["_tag"]]+?: ((error: Extract<E, { _tag: K }>) => Route.Handler<any, any>) } | ||
: {} | ||
@@ -456,7 +564,10 @@ >( | ||
self: Router<R, E> | ||
) => Router.WithoutProvided< | ||
| R | ||
| { | ||
[K in keyof Cases]: Cases[K] extends (...args: Array<any>) => Effect.Effect<infer R, any, any> ? R : never | ||
}[keyof Cases], | ||
) => Router< | ||
| Exclude<R, RouteContext | ServerRequest.ServerRequest> | ||
| Exclude< | ||
{ | ||
[K in keyof Cases]: Cases[K] extends (...args: Array<any>) => Effect.Effect<infer R, any, any> ? R : never | ||
}[keyof Cases], | ||
RouteContext | ServerRequest.ServerRequest | ||
>, | ||
| Exclude<E, { _tag: keyof Cases }> | ||
@@ -471,3 +582,3 @@ | { | ||
Cases extends E extends { _tag: string } | ||
? { [K in E["_tag"]]+?: ((error: Extract<E, { _tag: K }>) => Route.Handler<any, any>) | undefined } : | ||
? { [K in E["_tag"]]+?: ((error: Extract<E, { _tag: K }>) => Route.Handler<any, any>) } : | ||
{} | ||
@@ -477,7 +588,10 @@ >( | ||
cases: Cases | ||
): Router.WithoutProvided< | ||
| R | ||
| { | ||
[K in keyof Cases]: Cases[K] extends (...args: Array<any>) => Effect.Effect<infer R, any, any> ? R : never | ||
}[keyof Cases], | ||
): Router< | ||
| Exclude<R, RouteContext | ServerRequest.ServerRequest> | ||
| Exclude< | ||
{ | ||
[K in keyof Cases]: Cases[K] extends (...args: Array<any>) => Effect.Effect<infer R, any, any> ? R : never | ||
}[keyof Cases], | ||
RouteContext | ServerRequest.ServerRequest | ||
>, | ||
| Exclude<E, { _tag: keyof Cases }> | ||
@@ -498,3 +612,5 @@ | { | ||
service: Context.Tag.Service<T> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router<Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, E> | ||
<R, E, T extends Context.Tag<any, any>>( | ||
@@ -504,3 +620,3 @@ self: Router<R, E>, | ||
service: Context.Tag.Service<T> | ||
): Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E> | ||
): Router<Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, E> | ||
} = internal.provideService | ||
@@ -516,3 +632,9 @@ | ||
effect: Effect.Effect<R1, E1, Context.Tag.Service<T>> | ||
): <R, E>(self: Router<R, E>) => Router.WithoutProvided<R1 | Exclude<R, Context.Tag.Identifier<T>>, E1 | E> | ||
): <R, E>( | ||
self: Router<R, E> | ||
) => Router< | ||
| Exclude<R1, RouteContext | ServerRequest.ServerRequest> | ||
| Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, | ||
E1 | E | ||
> | ||
<R, E, T extends Context.Tag<any, any>, R1, E1>( | ||
@@ -522,3 +644,7 @@ self: Router<R, E>, | ||
effect: Effect.Effect<R1, E1, Context.Tag.Service<T>> | ||
): Router.WithoutProvided<R1 | Exclude<R, Context.Tag.Identifier<T>>, E | E1> | ||
): Router< | ||
| Exclude<R1, RouteContext | ServerRequest.ServerRequest> | ||
| Exclude<Exclude<R, Context.Tag.Identifier<T>>, RouteContext | ServerRequest.ServerRequest>, | ||
E | E1 | ||
> | ||
} = internal.provideServiceEffect |
@@ -250,3 +250,3 @@ import * as Chunk from "@effect/data/Chunk" | ||
self: Router.Router<R, E> | ||
) => Router.Router.WithoutProvided<R | R1, E | E1>, | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, E | E1>, | ||
<R, E, R1, E1>( | ||
@@ -256,3 +256,3 @@ self: Router.Router<R, E>, | ||
that: App.Default<R1, E1> | ||
) => Router.Router.WithoutProvided<R | R1, E | E1> | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, E | E1> | ||
>( | ||
@@ -271,3 +271,3 @@ 3, | ||
self: Router.Router<R, E> | ||
) => Router.Router.WithoutProvided<R | R1, E1 | E> | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, E1 | E> | ||
<R, E, R1, E1>( | ||
@@ -277,3 +277,3 @@ self: Router.Router<R, E>, | ||
handler: Router.Route.Handler<R1, E1> | ||
): Router.Router.WithoutProvided<R | R1, E1 | E> | ||
): Router.Router<Router.Router.ExcludeProvided<R | R1>, E1 | E> | ||
} => | ||
@@ -286,3 +286,3 @@ dual< | ||
self: Router.Router<R, E> | ||
) => Router.Router.WithoutProvided<R | R1, E | E1>, | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, E | E1>, | ||
<R, E, R1, E1>( | ||
@@ -292,3 +292,3 @@ self: Router.Router<R, E>, | ||
handler: Router.Route.Handler<R1, E1> | ||
) => Router.Router.WithoutProvided<R | R1, E | E1> | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, E | E1> | ||
>(3, (self, path, handler) => | ||
@@ -328,7 +328,7 @@ new RouterImpl<any, any>( | ||
f: (self: Router.Route.Handler<R, E>) => App.Default<R1, E1> | ||
) => (self: Router.Router<R, E>) => Router.Router.WithoutProvided<R1, E1>, | ||
) => (self: Router.Router<R, E>) => Router.Router<Router.Router.ExcludeProvided<R1>, E1>, | ||
<R, E, R1, E1>( | ||
self: Router.Router<R, E>, | ||
f: (self: Router.Route.Handler<R, E>) => App.Default<R1, E1> | ||
) => Router.Router.WithoutProvided<R1, E1> | ||
) => Router.Router<Router.Router.ExcludeProvided<R1>, E1> | ||
>(2, (self, f) => | ||
@@ -350,7 +350,7 @@ new RouterImpl<any, any>( | ||
f: (e: E) => Router.Route.Handler<R2, E2> | ||
) => <R>(self: Router.Router<R, E>) => Router.Router.WithoutProvided<R2 | R, E2>, | ||
) => <R>(self: Router.Router<R, E>) => Router.Router<Router.Router.ExcludeProvided<R2 | R>, E2>, | ||
<R, E, R2, E2>( | ||
self: Router.Router<R, E>, | ||
f: (e: E) => Router.Route.Handler<R2, E2> | ||
) => Router.Router.WithoutProvided<R2 | R, E2> | ||
) => Router.Router<Router.Router.ExcludeProvided<R2 | R>, E2> | ||
>(2, (self, f) => use(self, Effect.catchAll(f))) | ||
@@ -362,7 +362,7 @@ | ||
f: (e: Cause.Cause<E>) => Router.Route.Handler<R2, E2> | ||
) => <R>(self: Router.Router<R, E>) => Router.Router.WithoutProvided<R2 | R, E2>, | ||
) => <R>(self: Router.Router<R, E>) => Router.Router<Router.Router.ExcludeProvided<R2 | R>, E2>, | ||
<R, E, R2, E2>( | ||
self: Router.Router<R, E>, | ||
f: (e: Cause.Cause<E>) => Router.Route.Handler<R2, E2> | ||
) => Router.Router.WithoutProvided<R2 | R, E2> | ||
) => Router.Router<Router.Router.ExcludeProvided<R2 | R>, E2> | ||
>(2, (self, f) => use(self, Effect.catchAllCause(f))) | ||
@@ -375,3 +375,5 @@ | ||
f: (e: Extract<E, { _tag: K }>) => Router.Route.Handler<R1, E1> | ||
) => <R>(self: Router.Router<R, E>) => Router.Router.WithoutProvided<R | R1, Exclude<E, { _tag: K }> | E1>, | ||
) => <R>( | ||
self: Router.Router<R, E> | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, Exclude<E, { _tag: K }> | E1>, | ||
<R, E, K extends (E extends { _tag: string } ? E["_tag"] : never), R1, E1>( | ||
@@ -381,3 +383,3 @@ self: Router.Router<R, E>, | ||
f: (e: Extract<E, { _tag: K }>) => Router.Route.Handler<R1, E1> | ||
) => Router.Router.WithoutProvided<R | R1, Exclude<E, { _tag: K }> | E1> | ||
) => Router.Router<Router.Router.ExcludeProvided<R | R1>, Exclude<E, { _tag: K }> | E1> | ||
>(3, (self, k, f) => use(self, Effect.catchTag(k, f))) | ||
@@ -395,7 +397,9 @@ | ||
cases: Cases | ||
): <R>(self: Router.Router<R, E>) => Router.Router.WithoutProvided< | ||
| R | ||
| { | ||
[K in keyof Cases]: Cases[K] extends ((...args: Array<any>) => Effect.Effect<infer R, any, any>) ? R : never | ||
}[keyof Cases], | ||
): <R>(self: Router.Router<R, E>) => Router.Router< | ||
Router.Router.ExcludeProvided< | ||
| R | ||
| { | ||
[K in keyof Cases]: Cases[K] extends ((...args: Array<any>) => Effect.Effect<infer R, any, any>) ? R : never | ||
}[keyof Cases] | ||
>, | ||
| Exclude<E, { _tag: keyof Cases }> | ||
@@ -416,7 +420,9 @@ | { | ||
cases: Cases | ||
): Router.Router.WithoutProvided< | ||
| R | ||
| { | ||
[K in keyof Cases]: Cases[K] extends ((...args: Array<any>) => Effect.Effect<infer R, any, any>) ? R : never | ||
}[keyof Cases], | ||
): Router.Router< | ||
Router.Router.ExcludeProvided< | ||
| R | ||
| { | ||
[K in keyof Cases]: Cases[K] extends ((...args: Array<any>) => Effect.Effect<infer R, any, any>) ? R : never | ||
}[keyof Cases] | ||
>, | ||
| Exclude<E, { _tag: keyof Cases }> | ||
@@ -433,3 +439,5 @@ | { | ||
service: Context.Tag.Service<T> | ||
) => <R, E>(self: Router.Router<R, E>) => Router.Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E>, | ||
) => <R, E>( | ||
self: Router.Router<R, E> | ||
) => Router.Router<Router.Router.ExcludeProvided<Exclude<R, Context.Tag.Identifier<T>>>, E>, | ||
<R, E, T extends Context.Tag<any, any>>( | ||
@@ -439,3 +447,3 @@ self: Router.Router<R, E>, | ||
service: Context.Tag.Service<T> | ||
) => Router.Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E> | ||
) => Router.Router<Router.Router.ExcludeProvided<Exclude<R, Context.Tag.Identifier<T>>>, E> | ||
>(3, <R, E, T extends Context.Tag<any, any>>( | ||
@@ -445,3 +453,3 @@ self: Router.Router<R, E>, | ||
service: Context.Tag.Service<T> | ||
): Router.Router.WithoutProvided<Exclude<R, Context.Tag.Identifier<T>>, E> => | ||
): Router.Router<Router.Router.ExcludeProvided<Exclude<R, Context.Tag.Identifier<T>>>, E> => | ||
use(self, Effect.provideService(tag, service))) | ||
@@ -456,4 +464,4 @@ | ||
self: Router.Router<R, E> | ||
) => Router.Router.WithoutProvided< | ||
R1 | Exclude<R, Context.Tag.Identifier<T>>, | ||
) => Router.Router< | ||
Router.Router.ExcludeProvided<R1 | Exclude<R, Context.Tag.Identifier<T>>>, | ||
E | E1 | ||
@@ -465,4 +473,4 @@ >, | ||
effect: Effect.Effect<R1, E1, Context.Tag.Service<T>> | ||
) => Router.Router.WithoutProvided< | ||
R1 | Exclude<R, Context.Tag.Identifier<T>>, | ||
) => Router.Router< | ||
Router.Router.ExcludeProvided<R1 | Exclude<R, Context.Tag.Identifier<T>>>, | ||
E | E1 | ||
@@ -469,0 +477,0 @@ > |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1040860
17859