effect-start 0.23.0 → 0.25.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.
- package/dist/ChildProcess.js +32 -20
- package/dist/Commander.js +377 -293
- package/dist/ContentNegotiation.js +424 -318
- package/dist/Cookies.js +340 -271
- package/dist/Development.js +85 -49
- package/dist/Effectify.js +22 -14
- package/dist/Entity.js +260 -195
- package/dist/Fetch.js +192 -0
- package/dist/FilePathPattern.js +88 -77
- package/dist/FileRouter.js +192 -136
- package/dist/FileRouterCodegen.js +262 -191
- package/dist/FileSystem.js +126 -64
- package/dist/Http.js +96 -77
- package/dist/PathPattern.js +311 -273
- package/dist/PlatformError.js +36 -21
- package/dist/PlatformRuntime.js +65 -40
- package/dist/Route.js +122 -79
- package/dist/RouteBody.js +83 -58
- package/dist/RouteError.js +46 -25
- package/dist/RouteHook.js +58 -34
- package/dist/RouteHttp.js +346 -237
- package/dist/RouteHttpTracer.js +86 -58
- package/dist/RouteMount.js +81 -58
- package/dist/RouteSchema.js +253 -170
- package/dist/RouteSse.js +87 -72
- package/dist/RouteTree.js +99 -73
- package/dist/RouteTrie.js +160 -133
- package/dist/SchemaExtra.js +87 -62
- package/dist/Socket.js +32 -21
- package/dist/SqlIntrospect.js +317 -268
- package/dist/Start.js +55 -25
- package/dist/StartApp.js +3 -21
- package/dist/StreamExtra.js +109 -74
- package/dist/System.js +37 -21
- package/dist/TuplePathPattern.js +64 -58
- package/dist/Unique.js +159 -120
- package/dist/Values.js +48 -32
- package/dist/bun/BunBundle.js +158 -109
- package/dist/bun/BunChildProcessSpawner.js +121 -82
- package/dist/bun/BunImportTrackerPlugin.js +85 -63
- package/dist/bun/BunRoute.js +135 -99
- package/dist/bun/BunRuntime.js +39 -29
- package/dist/bun/BunServer.js +268 -140
- package/dist/bun/BunVirtualFilesPlugin.js +47 -33
- package/dist/bun/_BunEnhancedResolve.js +107 -82
- package/dist/bun/index.js +5 -5
- package/dist/bundler/Bundle.js +82 -38
- package/dist/bundler/BundleFiles.js +140 -82
- package/dist/bundler/BundleRoute.js +49 -38
- package/dist/client/Overlay.js +29 -28
- package/dist/client/ScrollState.js +94 -82
- package/dist/client/index.js +79 -61
- package/dist/console/Console.js +40 -24
- package/dist/console/ConsoleErrors.js +189 -178
- package/dist/console/ConsoleLogger.js +52 -43
- package/dist/console/ConsoleMetrics.js +69 -58
- package/dist/console/ConsoleProcess.js +57 -47
- package/dist/console/ConsoleStore.js +56 -45
- package/dist/console/ConsoleTracer.js +101 -88
- package/dist/console/Simulation.js +714 -563
- package/dist/console/index.js +3 -3
- package/dist/console/routes/tree.js +29 -28
- package/dist/datastar/actions/fetch.js +514 -381
- package/dist/datastar/actions/peek.js +12 -12
- package/dist/datastar/actions/setAll.js +18 -11
- package/dist/datastar/actions/toggleAll.js +18 -11
- package/dist/datastar/attributes/attr.js +48 -47
- package/dist/datastar/attributes/bind.js +186 -167
- package/dist/datastar/attributes/class.js +51 -44
- package/dist/datastar/attributes/computed.js +23 -24
- package/dist/datastar/attributes/effect.js +9 -8
- package/dist/datastar/attributes/indicator.js +32 -29
- package/dist/datastar/attributes/init.js +26 -25
- package/dist/datastar/attributes/jsonSignals.js +32 -29
- package/dist/datastar/attributes/on.js +76 -73
- package/dist/datastar/attributes/onIntersect.js +51 -51
- package/dist/datastar/attributes/onInterval.js +30 -29
- package/dist/datastar/attributes/onSignalPatch.js +49 -40
- package/dist/datastar/attributes/ref.js +10 -9
- package/dist/datastar/attributes/show.js +31 -30
- package/dist/datastar/attributes/signals.js +17 -16
- package/dist/datastar/attributes/style.js +56 -49
- package/dist/datastar/attributes/text.js +28 -25
- package/dist/datastar/engine.js +1079 -933
- package/dist/datastar/index.js +25 -24
- package/dist/datastar/utils.js +203 -155
- package/dist/datastar/watchers/patchElements.js +459 -372
- package/dist/datastar/watchers/patchSignals.js +13 -13
- package/dist/experimental/EncryptedCookies.js +305 -189
- package/dist/experimental/index.js +1 -1
- package/dist/hyper/Hyper.js +22 -17
- package/dist/hyper/HyperHtml.js +138 -123
- package/dist/hyper/HyperNode.js +11 -9
- package/dist/hyper/HyperRoute.js +41 -28
- package/dist/hyper/html.js +27 -27
- package/dist/hyper/index.js +5 -5
- package/dist/hyper/jsx-runtime.js +11 -5
- package/dist/index.js +8 -8
- package/dist/node/NodeFileSystem.js +606 -341
- package/dist/node/NodeUtils.js +21 -18
- package/dist/sql/Sql.js +8 -0
- package/dist/sql/bun/index.js +134 -67
- package/dist/sql/index.js +1 -0
- package/dist/sql/libsql/index.js +156 -0
- package/dist/sql/mssql/docker.js +103 -60
- package/dist/sql/mssql/index.js +182 -101
- package/dist/testing/TestLogger.js +39 -29
- package/dist/testing/index.js +2 -2
- package/dist/testing/utils.js +45 -23
- package/dist/x/cloudflare/CloudflareTunnel.js +61 -28
- package/dist/x/cloudflare/index.js +1 -1
- package/dist/x/tailscale/TailscaleTunnel.js +86 -60
- package/dist/x/tailscale/index.js +1 -1
- package/dist/x/tailwind/TailwindPlugin.js +280 -205
- package/dist/x/tailwind/compile.js +185 -129
- package/dist/x/tailwind/plugin.js +13 -11
- package/package.json +1 -1
- package/src/Development.ts +3 -1
- package/src/Entity.ts +17 -0
- package/src/Fetch.ts +271 -0
- package/src/SqlIntrospect.ts +64 -70
- package/src/Start.ts +24 -22
- package/src/StartApp.ts +11 -0
- package/src/bun/BunServer.ts +89 -16
- package/src/hyper/HyperHtml.ts +0 -1
- package/src/sql/bun/index.ts +1 -1
- package/src/sql/index.ts +1 -0
- package/src/sql/libsql/index.ts +173 -0
- package/src/sql/libsql/libsql.d.ts +39 -0
- package/src/sql/mssql/index.ts +1 -1
- package/src/x/tailscale/TailscaleTunnel.ts +7 -5
- package/dist/BlobStore.d.ts +0 -80
- package/dist/BlobStore.js +0 -19
- package/dist/ChildProcess.d.ts +0 -60
- package/dist/Commander.d.ts +0 -100
- package/dist/ContentNegotiation.d.ts +0 -12
- package/dist/Cookies.d.ts +0 -47
- package/dist/Development.d.ts +0 -39
- package/dist/Effectify.d.ts +0 -209
- package/dist/Entity.d.ts +0 -47
- package/dist/FilePathPattern.d.ts +0 -29
- package/dist/FileRouter.d.ts +0 -56
- package/dist/FileRouterCodegen.d.ts +0 -18
- package/dist/FileRouterPattern.d.ts +0 -9
- package/dist/FileRouterPattern.js +0 -35
- package/dist/FileSystem.d.ts +0 -158
- package/dist/Http.d.ts +0 -37
- package/dist/HttpAppExtra.d.ts +0 -7
- package/dist/HttpAppExtra.js +0 -320
- package/dist/HttpUtils.d.ts +0 -3
- package/dist/HttpUtils.js +0 -11
- package/dist/PathPattern.d.ts +0 -134
- package/dist/PlatformError.d.ts +0 -38
- package/dist/PlatformRuntime.d.ts +0 -27
- package/dist/Route.d.ts +0 -97
- package/dist/RouteBody.d.ts +0 -47
- package/dist/RouteError.d.ts +0 -98
- package/dist/RouteHook.d.ts +0 -12
- package/dist/RouteHttp.d.ts +0 -21
- package/dist/RouteHttpTracer.d.ts +0 -10
- package/dist/RouteMount.d.ts +0 -86
- package/dist/RouteSchema.d.ts +0 -86
- package/dist/RouteSse.d.ts +0 -21
- package/dist/RouteTree.d.ts +0 -57
- package/dist/RouteTrie.d.ts +0 -20
- package/dist/RouterPattern.d.ts +0 -118
- package/dist/RouterPattern.js +0 -269
- package/dist/SchemaExtra.d.ts +0 -7
- package/dist/Socket.d.ts +0 -27
- package/dist/Sql.d.ts +0 -34
- package/dist/Sql.js +0 -5
- package/dist/SqlIntrospect.d.ts +0 -91
- package/dist/Start.d.ts +0 -44
- package/dist/StartApp.d.ts +0 -19
- package/dist/StreamExtra.d.ts +0 -28
- package/dist/System.d.ts +0 -7
- package/dist/TuplePathPattern.d.ts +0 -9
- package/dist/Unique.d.ts +0 -50
- package/dist/Values.d.ts +0 -27
- package/dist/bun/BunBlobStoreDisk.d.ts +0 -6
- package/dist/bun/BunBlobStoreDisk.js +0 -116
- package/dist/bun/BunBlobStoreS3.d.ts +0 -11
- package/dist/bun/BunBlobStoreS3.js +0 -89
- package/dist/bun/BunBlobWatcherDisk.d.ts +0 -6
- package/dist/bun/BunBlobWatcherDisk.js +0 -60
- package/dist/bun/BunBlobWatcherQueue.d.ts +0 -6
- package/dist/bun/BunBlobWatcherQueue.js +0 -17
- package/dist/bun/BunBundle.d.ts +0 -11
- package/dist/bun/BunChildProcessSpawner.d.ts +0 -3
- package/dist/bun/BunHttpServer.d.ts +0 -44
- package/dist/bun/BunHttpServer.js +0 -186
- package/dist/bun/BunHttpServer_web.d.ts +0 -60
- package/dist/bun/BunHttpServer_web.js +0 -252
- package/dist/bun/BunImportTrackerPlugin.d.ts +0 -13
- package/dist/bun/BunPlatformHttpServer.d.ts +0 -10
- package/dist/bun/BunPlatformHttpServer.js +0 -53
- package/dist/bun/BunRoute.d.ts +0 -48
- package/dist/bun/BunRuntime.d.ts +0 -2
- package/dist/bun/BunServer.d.ts +0 -40
- package/dist/bun/BunServerRequest.d.ts +0 -60
- package/dist/bun/BunServerRequest.js +0 -252
- package/dist/bun/BunSql.d.ts +0 -4
- package/dist/bun/BunSql.js +0 -81
- package/dist/bun/BunVirtualFilesPlugin.d.ts +0 -4
- package/dist/bun/_BunEnhancedResolve.d.ts +0 -45
- package/dist/bun/index.d.ts +0 -5
- package/dist/bundler/Bundle.d.ts +0 -61
- package/dist/bundler/BundleFiles.d.ts +0 -13
- package/dist/bundler/BundleHttp.d.ts +0 -45
- package/dist/bundler/BundleHttp.js +0 -176
- package/dist/bundler/BundleRoute.d.ts +0 -27
- package/dist/client/Overlay.d.ts +0 -2
- package/dist/client/ScrollState.d.ts +0 -6
- package/dist/client/index.d.ts +0 -6
- package/dist/console/Console.d.ts +0 -6
- package/dist/console/ConsoleErrors.d.ts +0 -3
- package/dist/console/ConsoleLogger.d.ts +0 -3
- package/dist/console/ConsoleMetrics.d.ts +0 -3
- package/dist/console/ConsoleProcess.d.ts +0 -3
- package/dist/console/ConsoleStore.d.ts +0 -144
- package/dist/console/ConsoleTracer.d.ts +0 -3
- package/dist/console/Simulation.d.ts +0 -2
- package/dist/console/index.d.ts +0 -3
- package/dist/console/routes/errors/route.d.ts +0 -10
- package/dist/console/routes/errors/route.js +0 -47
- package/dist/console/routes/fiberDetail.d.ts +0 -16
- package/dist/console/routes/fiberDetail.js +0 -38
- package/dist/console/routes/fibers/route.d.ts +0 -10
- package/dist/console/routes/fibers/route.js +0 -19
- package/dist/console/routes/git/route.d.ts +0 -11
- package/dist/console/routes/git/route.js +0 -33
- package/dist/console/routes/layout.d.ts +0 -9
- package/dist/console/routes/layout.js +0 -3
- package/dist/console/routes/logs/route.d.ts +0 -10
- package/dist/console/routes/logs/route.js +0 -32
- package/dist/console/routes/metrics/route.d.ts +0 -10
- package/dist/console/routes/metrics/route.js +0 -17
- package/dist/console/routes/route.d.ts +0 -6
- package/dist/console/routes/route.js +0 -5
- package/dist/console/routes/routes/route.d.ts +0 -6
- package/dist/console/routes/routes/route.js +0 -20
- package/dist/console/routes/services/route.d.ts +0 -6
- package/dist/console/routes/services/route.js +0 -12
- package/dist/console/routes/system/route.d.ts +0 -10
- package/dist/console/routes/system/route.js +0 -18
- package/dist/console/routes/traceDetail.d.ts +0 -16
- package/dist/console/routes/traceDetail.js +0 -14
- package/dist/console/routes/traces/route.d.ts +0 -10
- package/dist/console/routes/traces/route.js +0 -39
- package/dist/console/routes/tree.d.ts +0 -153
- package/dist/console/ui/Errors.d.ts +0 -4
- package/dist/console/ui/Errors.js +0 -15
- package/dist/console/ui/Fibers.d.ts +0 -24
- package/dist/console/ui/Fibers.js +0 -121
- package/dist/console/ui/Git.d.ts +0 -20
- package/dist/console/ui/Git.js +0 -95
- package/dist/console/ui/Logs.d.ts +0 -4
- package/dist/console/ui/Logs.js +0 -25
- package/dist/console/ui/Metrics.d.ts +0 -4
- package/dist/console/ui/Metrics.js +0 -26
- package/dist/console/ui/Routes.d.ts +0 -8
- package/dist/console/ui/Routes.js +0 -70
- package/dist/console/ui/Services.d.ts +0 -10
- package/dist/console/ui/Services.js +0 -246
- package/dist/console/ui/Shell.d.ts +0 -10
- package/dist/console/ui/Shell.js +0 -7
- package/dist/console/ui/System.d.ts +0 -4
- package/dist/console/ui/System.js +0 -35
- package/dist/console/ui/Traces.d.ts +0 -12
- package/dist/console/ui/Traces.js +0 -179
- package/dist/datastar/actions/fetch.d.ts +0 -30
- package/dist/datastar/actions/peek.d.ts +0 -1
- package/dist/datastar/actions/setAll.d.ts +0 -1
- package/dist/datastar/actions/toggleAll.d.ts +0 -1
- package/dist/datastar/attributes/attr.d.ts +0 -1
- package/dist/datastar/attributes/bind.d.ts +0 -1
- package/dist/datastar/attributes/class.d.ts +0 -1
- package/dist/datastar/attributes/computed.d.ts +0 -1
- package/dist/datastar/attributes/effect.d.ts +0 -1
- package/dist/datastar/attributes/indicator.d.ts +0 -1
- package/dist/datastar/attributes/init.d.ts +0 -1
- package/dist/datastar/attributes/jsonSignals.d.ts +0 -1
- package/dist/datastar/attributes/on.d.ts +0 -1
- package/dist/datastar/attributes/onIntersect.d.ts +0 -1
- package/dist/datastar/attributes/onInterval.d.ts +0 -1
- package/dist/datastar/attributes/onSignalPatch.d.ts +0 -1
- package/dist/datastar/attributes/ref.d.ts +0 -1
- package/dist/datastar/attributes/show.d.ts +0 -1
- package/dist/datastar/attributes/signals.d.ts +0 -1
- package/dist/datastar/attributes/style.d.ts +0 -1
- package/dist/datastar/attributes/text.d.ts +0 -1
- package/dist/datastar/engine.d.ts +0 -162
- package/dist/datastar/happydom.d.ts +0 -1
- package/dist/datastar/happydom.js +0 -8
- package/dist/datastar/index.d.ts +0 -24
- package/dist/datastar/load.d.ts +0 -24
- package/dist/datastar/load.js +0 -24
- package/dist/datastar/utils.d.ts +0 -51
- package/dist/datastar/watchers/patchElements.d.ts +0 -1
- package/dist/datastar/watchers/patchSignals.d.ts +0 -1
- package/dist/experimental/EncryptedCookies.d.ts +0 -48
- package/dist/experimental/SseHttpResponse.d.ts +0 -7
- package/dist/experimental/SseHttpResponse.js +0 -28
- package/dist/experimental/index.d.ts +0 -1
- package/dist/hyper/Hyper.d.ts +0 -25
- package/dist/hyper/HyperHtml.d.ts +0 -23
- package/dist/hyper/HyperHtml.test.d.ts +0 -1
- package/dist/hyper/HyperHtml.test.js +0 -197
- package/dist/hyper/HyperNode.d.ts +0 -14
- package/dist/hyper/HyperRoute.d.ts +0 -8
- package/dist/hyper/HyperRoute.test.d.ts +0 -1
- package/dist/hyper/HyperRoute.test.js +0 -83
- package/dist/hyper/html.d.ts +0 -11
- package/dist/hyper/index.d.ts +0 -6
- package/dist/hyper/jsx-runtime.d.ts +0 -7
- package/dist/index.d.ts +0 -8
- package/dist/inference_check.d.ts +0 -1
- package/dist/inference_check.js +0 -15
- package/dist/lint/plugin.d.ts +0 -86
- package/dist/lint/plugin.js +0 -341
- package/dist/middlewares/BasicAuthMiddleware.d.ts +0 -8
- package/dist/middlewares/BasicAuthMiddleware.js +0 -22
- package/dist/middlewares/index.d.ts +0 -1
- package/dist/middlewares/index.js +0 -1
- package/dist/node/Effectify.d.ts +0 -209
- package/dist/node/Effectify.js +0 -19
- package/dist/node/FileSystem.d.ts +0 -7
- package/dist/node/FileSystem.js +0 -420
- package/dist/node/NodeFileSystem.d.ts +0 -7
- package/dist/node/NodeUtils.d.ts +0 -2
- package/dist/node/PlatformError.d.ts +0 -46
- package/dist/node/PlatformError.js +0 -43
- package/dist/node/Utils.d.ts +0 -1
- package/dist/node/Utils.js +0 -19
- package/dist/repro_fail.d.ts +0 -1
- package/dist/repro_fail.js +0 -14
- package/dist/sql/bun/index.d.ts +0 -3
- package/dist/sql/mssql/docker.d.ts +0 -2
- package/dist/sql/mssql/index.d.ts +0 -21
- package/dist/testing/TestHttpClient.d.ts +0 -13
- package/dist/testing/TestHttpClient.js +0 -68
- package/dist/testing/TestLogger.d.ts +0 -13
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/utils.d.ts +0 -9
- package/dist/x/cloudflare/CloudflareTunnel.d.ts +0 -10
- package/dist/x/cloudflare/index.d.ts +0 -1
- package/dist/x/datastar/Datastar.d.ts +0 -6
- package/dist/x/datastar/Datastar.js +0 -47
- package/dist/x/datastar/index.d.ts +0 -1
- package/dist/x/datastar/index.js +0 -1
- package/dist/x/tailscale/TailscaleTunnel.d.ts +0 -15
- package/dist/x/tailscale/index.d.ts +0 -1
- package/dist/x/tailwind/TailwindPlugin.d.ts +0 -23
- package/dist/x/tailwind/compile.d.ts +0 -19
- package/dist/x/tailwind/plugin.d.ts +0 -2
- /package/src/{Sql.ts → sql/Sql.ts} +0 -0
package/dist/PlatformError.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type * as Cause from "effect/Cause";
|
|
2
|
-
import type * as Types from "effect/Types";
|
|
3
|
-
export declare const TypeId: unique symbol;
|
|
4
|
-
export type TypeId = typeof TypeId;
|
|
5
|
-
export declare const isPlatformError: (u: unknown) => u is PlatformError;
|
|
6
|
-
export declare const TypeIdError: <const TypeId extends symbol, const Tag extends string>(typeId: TypeId, tag: Tag) => (new <A extends Record<string, any>>(args: Types.Simplify<A>) => Cause.YieldableError & Record<TypeId, TypeId> & {
|
|
7
|
-
readonly _tag: Tag;
|
|
8
|
-
} & Readonly<A>);
|
|
9
|
-
export type SystemErrorReason = "AlreadyExists" | "BadResource" | "Busy" | "InvalidData" | "NotFound" | "PermissionDenied" | "TimedOut" | "UnexpectedEof" | "Unknown" | "WouldBlock" | "WriteZero";
|
|
10
|
-
declare const BadArgument_base: new <A extends Record<string, any> = {}>(args: Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Cause.YieldableError & {
|
|
11
|
-
readonly _tag: "BadArgument";
|
|
12
|
-
} & Readonly<A>;
|
|
13
|
-
export declare class BadArgument extends BadArgument_base<{
|
|
14
|
-
module: string;
|
|
15
|
-
method: string;
|
|
16
|
-
description?: string | undefined;
|
|
17
|
-
cause?: unknown;
|
|
18
|
-
}> {
|
|
19
|
-
readonly [TypeId]: typeof TypeId;
|
|
20
|
-
get message(): string;
|
|
21
|
-
}
|
|
22
|
-
declare const SystemError_base: new <A extends Record<string, any> = {}>(args: Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Cause.YieldableError & {
|
|
23
|
-
readonly _tag: "SystemError";
|
|
24
|
-
} & Readonly<A>;
|
|
25
|
-
export declare class SystemError extends SystemError_base<{
|
|
26
|
-
reason: SystemErrorReason;
|
|
27
|
-
module: string;
|
|
28
|
-
method: string;
|
|
29
|
-
description?: string | undefined;
|
|
30
|
-
syscall?: string | undefined;
|
|
31
|
-
pathOrDescriptor?: string | number | undefined;
|
|
32
|
-
cause?: unknown;
|
|
33
|
-
}> {
|
|
34
|
-
readonly [TypeId]: typeof TypeId;
|
|
35
|
-
get message(): string;
|
|
36
|
-
}
|
|
37
|
-
export type PlatformError = BadArgument | SystemError;
|
|
38
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Exit from "effect/Exit";
|
|
3
|
-
import type * as Fiber from "effect/Fiber";
|
|
4
|
-
export interface Teardown {
|
|
5
|
-
<E, A>(exit: Exit.Exit<E, A>, onExit: (code: number) => void): void;
|
|
6
|
-
}
|
|
7
|
-
export declare const defaultTeardown: Teardown;
|
|
8
|
-
export interface RunMain {
|
|
9
|
-
(options?: {
|
|
10
|
-
readonly disableErrorReporting?: boolean | undefined;
|
|
11
|
-
readonly disablePrettyLogger?: boolean | undefined;
|
|
12
|
-
readonly teardown?: Teardown | undefined;
|
|
13
|
-
}): <E, A>(effect: Effect.Effect<A, E>) => void;
|
|
14
|
-
<E, A>(effect: Effect.Effect<A, E>, options?: {
|
|
15
|
-
readonly disableErrorReporting?: boolean | undefined;
|
|
16
|
-
readonly disablePrettyLogger?: boolean | undefined;
|
|
17
|
-
readonly teardown?: Teardown | undefined;
|
|
18
|
-
}): void;
|
|
19
|
-
}
|
|
20
|
-
export declare const makeRunMain: (f: <E, A>(options: {
|
|
21
|
-
readonly fiber: Fiber.RuntimeFiber<A, E>;
|
|
22
|
-
readonly teardown: Teardown;
|
|
23
|
-
}) => void) => RunMain;
|
|
24
|
-
/**
|
|
25
|
-
* Are we running within an agent harness, like Claude Code?
|
|
26
|
-
*/
|
|
27
|
-
export declare function isAgentHarness(): string | false | undefined;
|
package/dist/Route.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import * as Context from "effect/Context";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as Pipeable from "effect/Pipeable";
|
|
5
|
-
import * as Entity from "./Entity.ts";
|
|
6
|
-
import * as RouteBody from "./RouteBody.ts";
|
|
7
|
-
import * as RouteTree from "./RouteTree.ts";
|
|
8
|
-
import type * as Values from "./Values.ts";
|
|
9
|
-
export declare const RouteItems: unique symbol;
|
|
10
|
-
export declare const RouteDescriptor: unique symbol;
|
|
11
|
-
export declare const RouteBindings: unique symbol;
|
|
12
|
-
export declare const TypeId: unique symbol;
|
|
13
|
-
export declare namespace RouteDescriptor {
|
|
14
|
-
type Any = {
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export declare namespace RouteSet {
|
|
19
|
-
type RouteSet<D extends RouteDescriptor.Any = {}, B = {}, M extends Route.Tuple = []> = Data<D, B, M> & {
|
|
20
|
-
[TypeId]: typeof TypeId;
|
|
21
|
-
} & Pipeable.Pipeable & Iterable<M[number]>;
|
|
22
|
-
type Data<D extends RouteDescriptor.Any = {}, B = {}, M extends Route.Tuple = []> = {
|
|
23
|
-
[RouteItems]: M;
|
|
24
|
-
[RouteDescriptor]: D;
|
|
25
|
-
[RouteBindings]: B;
|
|
26
|
-
};
|
|
27
|
-
type Proto = Pipeable.Pipeable & Iterable<Route.Route<any, any, any, any, any>> & {
|
|
28
|
-
[TypeId]: typeof TypeId;
|
|
29
|
-
};
|
|
30
|
-
type Any = RouteSet<{}, {}, Route.Tuple>;
|
|
31
|
-
type Infer<R> = R extends RouteSet<infer D, infer B, infer I> ? RouteSet<D, B, I> : R;
|
|
32
|
-
type Items<T extends Data<any, any, any>> = T extends Data<any, any, infer M> ? M : never;
|
|
33
|
-
type Descriptor<T extends Data<any, any, any>> = T extends Data<infer D, any, any> ? D : never;
|
|
34
|
-
}
|
|
35
|
-
export declare namespace Route {
|
|
36
|
-
export interface Route<D extends RouteDescriptor.Any = {}, B = {}, A = any, E = never, R = never> extends RouteSet.RouteSet<D, {}, [Route<D, B, A, E, R>]> {
|
|
37
|
-
readonly handler: Handler<B & D, A, E, R>;
|
|
38
|
-
}
|
|
39
|
-
export type With<D extends RouteDescriptor.Any> = Route<any, any, any, any, any> & {
|
|
40
|
-
[RouteDescriptor]: D;
|
|
41
|
-
};
|
|
42
|
-
export type Tuple<_D extends RouteDescriptor.Any = {}> = [...Route<any, any, any, any, any>[]];
|
|
43
|
-
export type Handler<B, A, E, R> = (context: B, next: (context?: Partial<B> & Record<string, unknown>) => Entity.Entity<A>) => Effect.Effect<Entity.Entity<A>, E, R>;
|
|
44
|
-
/**
|
|
45
|
-
* Extracts only the bindings (B) from routes, excluding descriptors.
|
|
46
|
-
*/
|
|
47
|
-
export type Bindings<T extends RouteSet.Any, M extends Tuple = RouteSet.Items<T>> = M extends [
|
|
48
|
-
infer Head,
|
|
49
|
-
...infer Tail extends Tuple
|
|
50
|
-
] ? Head extends Route<any, infer B, any, any, any> ? ShallowMerge<B, Bindings<T, Tail>> : Bindings<T, Tail> : {};
|
|
51
|
-
/**
|
|
52
|
-
* Extracts the full handler context from a RouteSet.
|
|
53
|
-
* Merges descriptors and bindings from all routes, with later values
|
|
54
|
-
* taking precedence via ShallowMerge to avoid `never` from conflicting
|
|
55
|
-
* literal types (e.g. `{ method: "*" } & { method: "GET" }`).
|
|
56
|
-
*/
|
|
57
|
-
export type Context<T extends RouteSet.Any> = Omit<RouteSet.Descriptor<T>, keyof ExtractContext<RouteSet.Items<T>>> & ExtractContext<RouteSet.Items<T>>;
|
|
58
|
-
type ExtractContext<M extends Tuple> = M extends [infer Head, ...infer Tail extends Tuple] ? Head extends Route<infer D, infer B, any, any, any> ? ShallowMerge<Omit<D, keyof B> & B, ExtractContext<Tail>> : ExtractContext<Tail> : {};
|
|
59
|
-
export {};
|
|
60
|
-
}
|
|
61
|
-
export declare function isRouteSet(input: unknown): input is RouteSet.Any;
|
|
62
|
-
export declare function isRoute(input: unknown): input is Route.Route;
|
|
63
|
-
export declare function set<D extends RouteDescriptor.Any = {}, B = {}, I extends Route.Tuple = []>(items?: I, descriptor?: D): RouteSet.RouteSet<D, B, I>;
|
|
64
|
-
export declare function make<D extends RouteDescriptor.Any, B, A, E = never, R = never>(handler: Route.Handler<B & D, A, E, R>, descriptor?: D): Route.Route<D, B, A, E, R>;
|
|
65
|
-
export declare const empty: RouteSet.RouteSet<{}, {}, []>;
|
|
66
|
-
export declare function describe<D extends RouteDescriptor.Any>(descriptor: D): RouteSet.RouteSet<D, {}, never[]>;
|
|
67
|
-
export declare function items<T extends RouteSet.Data<any, any, any>>(self: T): RouteSet.Items<T>;
|
|
68
|
-
export declare function descriptor<T extends RouteSet.Data<any, any, any>>(self: T): T[typeof RouteDescriptor];
|
|
69
|
-
export declare function descriptor<T extends RouteSet.Data<any, any, any>>(self: Iterable<T>): Array<T[typeof RouteDescriptor]>;
|
|
70
|
-
export type ExtractBindings<M extends Route.Tuple> = M extends [
|
|
71
|
-
infer Head,
|
|
72
|
-
...infer Tail extends Route.Tuple
|
|
73
|
-
] ? Head extends Route.Route<any, infer B, any, any, any> ? ShallowMerge<B, ExtractBindings<Tail>> : ExtractBindings<Tail> : {};
|
|
74
|
-
type ShallowMerge<A, B> = Omit<A, keyof B> & {
|
|
75
|
-
[K in keyof B]: K extends keyof A ? A[K] & B[K] : B[K];
|
|
76
|
-
};
|
|
77
|
-
export type ExtractContext<Items extends Route.Tuple, Descriptor extends RouteDescriptor.Any> = ExtractBindings<Items> & Descriptor;
|
|
78
|
-
export * from "./RouteHook.ts";
|
|
79
|
-
export * from "./RouteSchema.ts";
|
|
80
|
-
export { add, del, get, head, options, patch, post, put, use } from "./RouteMount.ts";
|
|
81
|
-
export declare const text: RouteBody.BuildReturn<string, "text">;
|
|
82
|
-
export declare const html: RouteBody.BuildReturn<string, "html">;
|
|
83
|
-
export declare const json: RouteBody.BuildReturn<Values.Json, "json">;
|
|
84
|
-
export declare const bytes: RouteBody.BuildReturn<Uint8Array<ArrayBufferLike>, "bytes">;
|
|
85
|
-
export { render } from "./RouteBody.ts";
|
|
86
|
-
export { sse } from "./RouteSse.ts";
|
|
87
|
-
export declare function redirect(url: string | URL, options?: {
|
|
88
|
-
status?: 301 | 302 | 303 | 307 | 308;
|
|
89
|
-
}): Entity.Entity<"">;
|
|
90
|
-
declare const Routes_base: Context.TagClass<Routes, "effect-start/Routes", RouteTree.RouteTree<RouteTree.RouteMap>>;
|
|
91
|
-
export declare class Routes extends Routes_base {
|
|
92
|
-
}
|
|
93
|
-
export declare function layer(routes: RouteTree.RouteMap | RouteTree.RouteTree): Layer.Layer<Routes, never, never>;
|
|
94
|
-
export { make as tree } from "./RouteTree.ts";
|
|
95
|
-
export declare function lazy<T extends RouteSet.Any>(load: () => Promise<{
|
|
96
|
-
default: T;
|
|
97
|
-
}>): Effect.Effect<T, never, never>;
|
package/dist/RouteBody.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import type * as Stream from "effect/Stream";
|
|
3
|
-
import type * as Utils from "effect/Utils";
|
|
4
|
-
import * as Entity from "./Entity.ts";
|
|
5
|
-
import * as Route from "./Route.ts";
|
|
6
|
-
import type * as Values from "./Values.ts";
|
|
7
|
-
export type Format = "text" | "html" | "json" | "bytes" | "*";
|
|
8
|
-
type UnwrapStream<T> = T extends Stream.Stream<infer V, any, any> ? V : T;
|
|
9
|
-
type YieldError<T> = T extends Utils.YieldWrap<Effect.Effect<any, infer E, any>> ? E : never;
|
|
10
|
-
type YieldContext<T> = T extends Utils.YieldWrap<Effect.Effect<any, any, infer R>> ? R : never;
|
|
11
|
-
export type GeneratorHandler<B, A, Y> = (context: Values.Simplify<B>, next: (context?: Partial<B> & Record<string, unknown>) => Entity.Entity<UnwrapStream<A>>) => Generator<Y, A | Entity.Entity<A>, never>;
|
|
12
|
-
export type HandlerInput<B, A, E, R> = A | Entity.Entity<A> | Effect.Effect<A | Entity.Entity<A>, E, R> | ((context: Values.Simplify<B>, next: (context?: Partial<B> & Record<string, unknown>) => Entity.Entity<UnwrapStream<A>>) => Effect.Effect<A | Entity.Entity<A>, E, R> | Generator<Utils.YieldWrap<Effect.Effect<unknown, E, R>>, A | Entity.Entity<A>, unknown>);
|
|
13
|
-
export declare function handle<B, A, Y extends Utils.YieldWrap<Effect.Effect<any, any, any>>>(handler: GeneratorHandler<B, A, Y>): Route.Route.Handler<B, A, YieldError<Y>, YieldContext<Y>>;
|
|
14
|
-
export declare function handle<B, A, E, R>(handler: HandlerInput<B, A, E, R>): Route.Route.Handler<B, A, E, R>;
|
|
15
|
-
export interface BuildReturn<Value, F extends Format> {
|
|
16
|
-
<D extends Route.RouteDescriptor.Any, B, I extends Route.Route.Tuple, A extends F extends "json" ? Value : Value | Stream.Stream<Value, any, any>, Y extends Utils.YieldWrap<Effect.Effect<any, any, any>>>(handler: GeneratorHandler<NoInfer<D & B & Route.ExtractBindings<I> & {
|
|
17
|
-
format: F;
|
|
18
|
-
}>, A, Y>): (self: Route.RouteSet.RouteSet<D, B, I>) => Route.RouteSet.RouteSet<D, B, [
|
|
19
|
-
...I,
|
|
20
|
-
Route.Route.Route<{
|
|
21
|
-
format: F;
|
|
22
|
-
}, {}, A, YieldError<Y>, YieldContext<Y>>
|
|
23
|
-
]>;
|
|
24
|
-
<D extends Route.RouteDescriptor.Any, B, I extends Route.Route.Tuple, A extends F extends "json" ? Value : Value | Stream.Stream<Value, any, any>, E = never, R = never>(handler: HandlerInput<NoInfer<D & B & Route.ExtractBindings<I> & {
|
|
25
|
-
format: F;
|
|
26
|
-
}>, A, E, R>): (self: Route.RouteSet.RouteSet<D, B, I>) => Route.RouteSet.RouteSet<D, B, [...I, Route.Route.Route<{
|
|
27
|
-
format: F;
|
|
28
|
-
}, {}, A, E, R>]>;
|
|
29
|
-
}
|
|
30
|
-
export declare function build<Value, F extends Format>(descriptors: {
|
|
31
|
-
format: F;
|
|
32
|
-
}): BuildReturn<Value, F>;
|
|
33
|
-
export type RenderValue = string | Uint8Array | Stream.Stream<string | Uint8Array, any, any>;
|
|
34
|
-
export declare function render<D extends Route.RouteDescriptor.Any, B extends {}, I extends Route.Route.Tuple, A extends RenderValue, Y extends Utils.YieldWrap<Effect.Effect<any, any, any>>>(handler: GeneratorHandler<NoInfer<D & B & Route.ExtractBindings<I> & {
|
|
35
|
-
format: "*";
|
|
36
|
-
}>, A, Y>): (self: Route.RouteSet.RouteSet<D, B, I>) => Route.RouteSet.RouteSet<D, B, [
|
|
37
|
-
...I,
|
|
38
|
-
Route.Route.Route<{
|
|
39
|
-
format: "*";
|
|
40
|
-
}, {}, A, YieldError<Y>, YieldContext<Y>>
|
|
41
|
-
]>;
|
|
42
|
-
export declare function render<D extends Route.RouteDescriptor.Any, B extends {}, I extends Route.Route.Tuple, A extends RenderValue, E = never, R = never>(handler: HandlerInput<NoInfer<D & B & Route.ExtractBindings<I> & {
|
|
43
|
-
format: "*";
|
|
44
|
-
}>, A, E, R>): (self: Route.RouteSet.RouteSet<D, B, I>) => Route.RouteSet.RouteSet<D, B, [...I, Route.Route.Route<{
|
|
45
|
-
format: "*";
|
|
46
|
-
}, {}, A, E, R>]>;
|
|
47
|
-
export {};
|
package/dist/RouteError.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
declare const BadRequest_base: Schema.TaggedErrorClass<BadRequest, "BadRequest", {
|
|
3
|
-
readonly _tag: Schema.tag<"BadRequest">;
|
|
4
|
-
} & {
|
|
5
|
-
message: typeof Schema.String;
|
|
6
|
-
}>;
|
|
7
|
-
export declare class BadRequest extends BadRequest_base {
|
|
8
|
-
static readonly status = 400;
|
|
9
|
-
}
|
|
10
|
-
declare const Unauthorized_base: Schema.TaggedErrorClass<Unauthorized, "Unauthorized", {
|
|
11
|
-
readonly _tag: Schema.tag<"Unauthorized">;
|
|
12
|
-
} & {
|
|
13
|
-
message: typeof Schema.String;
|
|
14
|
-
}>;
|
|
15
|
-
export declare class Unauthorized extends Unauthorized_base {
|
|
16
|
-
static readonly status = 401;
|
|
17
|
-
}
|
|
18
|
-
declare const Forbidden_base: Schema.TaggedErrorClass<Forbidden, "Forbidden", {
|
|
19
|
-
readonly _tag: Schema.tag<"Forbidden">;
|
|
20
|
-
} & {
|
|
21
|
-
message: typeof Schema.String;
|
|
22
|
-
}>;
|
|
23
|
-
export declare class Forbidden extends Forbidden_base {
|
|
24
|
-
static readonly status = 403;
|
|
25
|
-
}
|
|
26
|
-
declare const NotFound_base: Schema.TaggedErrorClass<NotFound, "NotFound", {
|
|
27
|
-
readonly _tag: Schema.tag<"NotFound">;
|
|
28
|
-
} & {
|
|
29
|
-
message: typeof Schema.String;
|
|
30
|
-
}>;
|
|
31
|
-
export declare class NotFound extends NotFound_base {
|
|
32
|
-
static readonly status = 404;
|
|
33
|
-
}
|
|
34
|
-
declare const MethodNotAllowed_base: Schema.TaggedErrorClass<MethodNotAllowed, "MethodNotAllowed", {
|
|
35
|
-
readonly _tag: Schema.tag<"MethodNotAllowed">;
|
|
36
|
-
} & {
|
|
37
|
-
message: typeof Schema.String;
|
|
38
|
-
}>;
|
|
39
|
-
export declare class MethodNotAllowed extends MethodNotAllowed_base {
|
|
40
|
-
static readonly status = 405;
|
|
41
|
-
}
|
|
42
|
-
declare const Conflict_base: Schema.TaggedErrorClass<Conflict, "Conflict", {
|
|
43
|
-
readonly _tag: Schema.tag<"Conflict">;
|
|
44
|
-
} & {
|
|
45
|
-
message: typeof Schema.String;
|
|
46
|
-
}>;
|
|
47
|
-
export declare class Conflict extends Conflict_base {
|
|
48
|
-
static readonly status = 409;
|
|
49
|
-
}
|
|
50
|
-
declare const Gone_base: Schema.TaggedErrorClass<Gone, "Gone", {
|
|
51
|
-
readonly _tag: Schema.tag<"Gone">;
|
|
52
|
-
} & {
|
|
53
|
-
message: typeof Schema.String;
|
|
54
|
-
}>;
|
|
55
|
-
export declare class Gone extends Gone_base {
|
|
56
|
-
static readonly status = 410;
|
|
57
|
-
}
|
|
58
|
-
declare const UnprocessableEntity_base: Schema.TaggedErrorClass<UnprocessableEntity, "UnprocessableEntity", {
|
|
59
|
-
readonly _tag: Schema.tag<"UnprocessableEntity">;
|
|
60
|
-
} & {
|
|
61
|
-
message: typeof Schema.String;
|
|
62
|
-
}>;
|
|
63
|
-
export declare class UnprocessableEntity extends UnprocessableEntity_base {
|
|
64
|
-
static readonly status = 422;
|
|
65
|
-
}
|
|
66
|
-
declare const TooManyRequests_base: Schema.TaggedErrorClass<TooManyRequests, "TooManyRequests", {
|
|
67
|
-
readonly _tag: Schema.tag<"TooManyRequests">;
|
|
68
|
-
} & {
|
|
69
|
-
message: typeof Schema.String;
|
|
70
|
-
}>;
|
|
71
|
-
export declare class TooManyRequests extends TooManyRequests_base {
|
|
72
|
-
static readonly status = 429;
|
|
73
|
-
}
|
|
74
|
-
declare const InternalServerError_base: Schema.TaggedErrorClass<InternalServerError, "InternalServerError", {
|
|
75
|
-
readonly _tag: Schema.tag<"InternalServerError">;
|
|
76
|
-
} & {
|
|
77
|
-
message: typeof Schema.String;
|
|
78
|
-
}>;
|
|
79
|
-
export declare class InternalServerError extends InternalServerError_base {
|
|
80
|
-
static readonly status = 500;
|
|
81
|
-
}
|
|
82
|
-
declare const NotImplemented_base: Schema.TaggedErrorClass<NotImplemented, "NotImplemented", {
|
|
83
|
-
readonly _tag: Schema.tag<"NotImplemented">;
|
|
84
|
-
} & {
|
|
85
|
-
message: typeof Schema.String;
|
|
86
|
-
}>;
|
|
87
|
-
export declare class NotImplemented extends NotImplemented_base {
|
|
88
|
-
static readonly status = 501;
|
|
89
|
-
}
|
|
90
|
-
declare const ServiceUnavailable_base: Schema.TaggedErrorClass<ServiceUnavailable, "ServiceUnavailable", {
|
|
91
|
-
readonly _tag: Schema.tag<"ServiceUnavailable">;
|
|
92
|
-
} & {
|
|
93
|
-
message: typeof Schema.String;
|
|
94
|
-
}>;
|
|
95
|
-
export declare class ServiceUnavailable extends ServiceUnavailable_base {
|
|
96
|
-
static readonly status = 503;
|
|
97
|
-
}
|
|
98
|
-
export {};
|
package/dist/RouteHook.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import type * as Utils from "effect/Utils";
|
|
3
|
-
import * as Route from "./Route.ts";
|
|
4
|
-
export type FilterResult<BOut, E, R> = {
|
|
5
|
-
context: BOut;
|
|
6
|
-
} | Effect.Effect<{
|
|
7
|
-
context: BOut;
|
|
8
|
-
}, E, R>;
|
|
9
|
-
export type FilterHandlerInput<BIn, BOut, E, R> = FilterResult<BOut, E, R> | ((context: BIn) => FilterResult<BOut, E, R> | Generator<Utils.YieldWrap<Effect.Effect<unknown, E, R>>, {
|
|
10
|
-
context: BOut;
|
|
11
|
-
}, unknown>);
|
|
12
|
-
export declare function filter<D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple, BOut extends {}, E = never, R = never, BIn = D & SB & Route.ExtractBindings<P>>(filterHandler: FilterHandlerInput<BIn, BOut, E, R>): (self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [...P, Route.Route.Route<{}, BOut, unknown, E, R>]>;
|
package/dist/RouteHttp.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as FiberId from "effect/FiberId";
|
|
2
|
-
import * as Runtime from "effect/Runtime";
|
|
3
|
-
import type * as Http from "./Http.ts";
|
|
4
|
-
import * as Route from "./Route.ts";
|
|
5
|
-
import type * as RouteBody from "./RouteBody.ts";
|
|
6
|
-
import type * as RouteMount from "./RouteMount.ts";
|
|
7
|
-
import * as RouteTree from "./RouteTree.ts";
|
|
8
|
-
type UnboundedRouteWithMethod = Route.Route.With<{
|
|
9
|
-
method: RouteMount.RouteMount.Method;
|
|
10
|
-
format?: RouteBody.Format;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* A synthetic fiber used to tag interruptions caused by client disconnects.
|
|
14
|
-
* Number stands for HTTP status 499 "Client Closed Request".
|
|
15
|
-
* This is what @effect/platform does to signal request cancelation.
|
|
16
|
-
*/
|
|
17
|
-
export declare const clientAbortFiberId: FiberId.Runtime;
|
|
18
|
-
export declare const toWebHandlerRuntime: <R>(runtime: Runtime.Runtime<R>) => (routes: Iterable<UnboundedRouteWithMethod>) => Http.WebHandler;
|
|
19
|
-
export declare const toWebHandler: (routes: Iterable<UnboundedRouteWithMethod>) => Http.WebHandler;
|
|
20
|
-
export declare function walkHandles(tree: RouteTree.RouteTree, runtime?: Runtime.Runtime<never>): Generator<[path: string, handler: Http.WebHandler]>;
|
|
21
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as FiberRef from "effect/FiberRef";
|
|
3
|
-
import * as Option from "effect/Option";
|
|
4
|
-
import type * as Predicate from "effect/Predicate";
|
|
5
|
-
import * as Tracer from "effect/Tracer";
|
|
6
|
-
export declare const currentTracerDisabledWhen: FiberRef.FiberRef<Predicate.Predicate<Request>>;
|
|
7
|
-
export declare const withTracerDisabledWhen: <A, E, R>(effect: Effect.Effect<A, E, R>, predicate: Predicate.Predicate<Request>) => Effect.Effect<A, E, R>;
|
|
8
|
-
export declare const currentSpanNameGenerator: FiberRef.FiberRef<(request: Request) => string>;
|
|
9
|
-
export declare const withSpanNameGenerator: <A, E, R>(effect: Effect.Effect<A, E, R>, f: (request: Request) => string) => Effect.Effect<A, E, R>;
|
|
10
|
-
export declare const parentSpanFromHeaders: (headers: Headers) => Option.Option<Tracer.ExternalSpan>;
|
package/dist/RouteMount.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type * as Types from "effect/Types";
|
|
2
|
-
import type * as Http from "./Http.ts";
|
|
3
|
-
import type * as PathPattern from "./PathPattern.ts";
|
|
4
|
-
import * as Route from "./Route.ts";
|
|
5
|
-
import type * as RouteBody from "./RouteBody.ts";
|
|
6
|
-
type Module = typeof import("./RouteMount.ts");
|
|
7
|
-
export type Self = RouteMount.Builder | Module;
|
|
8
|
-
export declare const use: RouteMount.Describer<"*">;
|
|
9
|
-
export declare const get: RouteMount.Describer<"GET">;
|
|
10
|
-
export declare const post: RouteMount.Describer<"POST">;
|
|
11
|
-
export declare const put: RouteMount.Describer<"PUT">;
|
|
12
|
-
export declare const del: RouteMount.Describer<"DELETE">;
|
|
13
|
-
export declare const patch: RouteMount.Describer<"PATCH">;
|
|
14
|
-
export declare const head: RouteMount.Describer<"HEAD">;
|
|
15
|
-
export declare const options: RouteMount.Describer<"OPTIONS">;
|
|
16
|
-
export declare const add: RouteMount.Add;
|
|
17
|
-
export type MountedRoute = Route.Route.Route<{
|
|
18
|
-
method: RouteMount.Method;
|
|
19
|
-
path: PathPattern.PathPattern;
|
|
20
|
-
format?: RouteBody.Format;
|
|
21
|
-
}, {}, any, any, any>;
|
|
22
|
-
export declare namespace RouteMount {
|
|
23
|
-
export type Method = "*" | Http.Method;
|
|
24
|
-
export type MountSet = Route.RouteSet.RouteSet<{
|
|
25
|
-
method: Method;
|
|
26
|
-
}, {}, Route.Route.Tuple>;
|
|
27
|
-
export interface Builder<D extends {} = {}, I extends Route.Route.Tuple = []> extends Route.RouteSet.RouteSet<D, {}, I>, Module {
|
|
28
|
-
}
|
|
29
|
-
export type EmptySet<M extends Method, B = {}> = Route.RouteSet.RouteSet<{
|
|
30
|
-
method: M;
|
|
31
|
-
}, B, []>;
|
|
32
|
-
export type Items<S> = S extends Builder<any, infer I> ? I : [];
|
|
33
|
-
export type BuilderBindings<S> = S extends Builder<any, infer I> ? Types.Simplify<WildcardBindings<I>> & {
|
|
34
|
-
request: Request;
|
|
35
|
-
} : {
|
|
36
|
-
request: Request;
|
|
37
|
-
};
|
|
38
|
-
type WildcardBindingsItem<T> = T extends Route.Route.Route<{
|
|
39
|
-
method: "*";
|
|
40
|
-
}, infer B, any, any, any> ? B : {};
|
|
41
|
-
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
42
|
-
export type WildcardBindings<I extends Route.Route.Tuple> = UnionToIntersection<{
|
|
43
|
-
[K in keyof I]: WildcardBindingsItem<I[K]>;
|
|
44
|
-
}[number]>;
|
|
45
|
-
type PrefixPathItem<Prefix extends string, T> = T extends Route.Route.Route<infer D, infer B, infer A, infer E, infer R> ? D extends {
|
|
46
|
-
path: infer P extends string;
|
|
47
|
-
} ? Route.Route.Route<Omit<D, "path"> & {
|
|
48
|
-
path: `${Prefix}${P}`;
|
|
49
|
-
}, B, A, E, R> : Route.Route.Route<D & {
|
|
50
|
-
path: Prefix;
|
|
51
|
-
}, B, A, E, R> : T;
|
|
52
|
-
export type PrefixPath<Prefix extends string, I extends Route.Route.Tuple> = {
|
|
53
|
-
[K in keyof I]: PrefixPathItem<Prefix, I[K]>;
|
|
54
|
-
} extends infer R extends Route.Route.Tuple ? R : never;
|
|
55
|
-
export interface Add {
|
|
56
|
-
<S extends Self, P extends string, R extends Route.RouteSet.Any>(this: S, path: P, routes: R): Builder<{}, [...Items<S>, ...PrefixPath<P, Route.RouteSet.Items<R>>]>;
|
|
57
|
-
<S extends Self, P extends string, R extends Route.RouteSet.Any>(this: S, path: P,
|
|
58
|
-
/**
|
|
59
|
-
* Callback form provides a builder seeded with higher-level bindings so
|
|
60
|
-
* nested routes can type-infer outer context when mounting.
|
|
61
|
-
*/
|
|
62
|
-
routes: (self: Builder<{}, []>) => R): Builder<{}, [...Items<S>, ...PrefixPath<P, Route.RouteSet.Items<R>>]>;
|
|
63
|
-
}
|
|
64
|
-
export type FlattenItems<M extends Method, B, I extends Route.Route.Tuple> = I extends [
|
|
65
|
-
Route.Route.Route<infer D, infer RB, infer A, infer E, infer R>,
|
|
66
|
-
...infer Tail extends Route.Route.Tuple
|
|
67
|
-
] ? [
|
|
68
|
-
Route.Route.Route<Types.Simplify<{
|
|
69
|
-
method: M;
|
|
70
|
-
} & D> & {}, Types.Simplify<Omit<B & RB, "request">>, A, E, R>,
|
|
71
|
-
...FlattenItems<M, Types.Simplify<B & RB>, Tail>
|
|
72
|
-
] : [];
|
|
73
|
-
export interface Describer<M extends Method> {
|
|
74
|
-
<S extends Self, A extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<A>>]>;
|
|
75
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<B>>]>;
|
|
76
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<C>>]>;
|
|
77
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any, D extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C, de: (d: C) => D): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<D>>]>;
|
|
78
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any, D extends Route.RouteSet.Any, E extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C, de: (d: C) => D, ef: (e: D) => E): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<E>>]>;
|
|
79
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any, D extends Route.RouteSet.Any, E extends Route.RouteSet.Any, F extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C, de: (d: C) => D, ef: (e: D) => E, fg: (f: E) => F): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<F>>]>;
|
|
80
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any, D extends Route.RouteSet.Any, E extends Route.RouteSet.Any, F extends Route.RouteSet.Any, G extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C, de: (d: C) => D, ef: (e: D) => E, fg: (f: E) => F, gh: (g: F) => G): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<G>>]>;
|
|
81
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any, D extends Route.RouteSet.Any, E extends Route.RouteSet.Any, F extends Route.RouteSet.Any, G extends Route.RouteSet.Any, H extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C, de: (d: C) => D, ef: (e: D) => E, fg: (f: E) => F, gh: (g: F) => G, hi: (h: G) => H): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<H>>]>;
|
|
82
|
-
<S extends Self, A extends Route.RouteSet.Any, B extends Route.RouteSet.Any, C extends Route.RouteSet.Any, D extends Route.RouteSet.Any, E extends Route.RouteSet.Any, F extends Route.RouteSet.Any, G extends Route.RouteSet.Any, H extends Route.RouteSet.Any, I extends Route.RouteSet.Any>(this: S, ab: (a: EmptySet<M, BuilderBindings<S>>) => A, bc: (b: A) => B, cd: (c: B) => C, de: (d: C) => D, ef: (e: D) => E, fg: (f: E) => F, gh: (g: F) => G, hi: (h: G) => H, ij: (i: H) => I): Builder<{}, [...Items<S>, ...FlattenItems<M, BuilderBindings<S>, Route.RouteSet.Items<I>>]>;
|
|
83
|
-
}
|
|
84
|
-
export {};
|
|
85
|
-
}
|
|
86
|
-
export {};
|
package/dist/RouteSchema.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type * as ParseResult from "effect/ParseResult";
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import type * as Scope from "effect/Scope";
|
|
4
|
-
import * as Http from "./Http.ts";
|
|
5
|
-
import * as Route from "./Route.ts";
|
|
6
|
-
export interface RequestBodyError {
|
|
7
|
-
readonly _tag: "RequestBodyError";
|
|
8
|
-
readonly reason: "JsonError" | "UrlParamsError" | "MultipartError" | "FormDataError";
|
|
9
|
-
readonly cause: unknown;
|
|
10
|
-
}
|
|
11
|
-
export declare const RequestBodyError: (reason: RequestBodyError["reason"], cause: unknown) => RequestBodyError;
|
|
12
|
-
export declare const File: Schema.TaggedStruct<"File", {
|
|
13
|
-
key: typeof Schema.String;
|
|
14
|
-
name: typeof Schema.String;
|
|
15
|
-
contentType: typeof Schema.String;
|
|
16
|
-
content: typeof Schema.Uint8ArrayFromSelf;
|
|
17
|
-
}>;
|
|
18
|
-
export declare function schemaHeaders<A, I extends Readonly<Record<string, string | undefined>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
19
|
-
...P,
|
|
20
|
-
Route.Route.Route<{}, {
|
|
21
|
-
headers: A;
|
|
22
|
-
}, unknown, ParseResult.ParseError, R>
|
|
23
|
-
]>;
|
|
24
|
-
export declare function schemaCookies<A, I extends Readonly<Record<string, string | undefined>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
25
|
-
...P,
|
|
26
|
-
Route.Route.Route<{}, {
|
|
27
|
-
cookies: A;
|
|
28
|
-
}, unknown, ParseResult.ParseError, R>
|
|
29
|
-
]>;
|
|
30
|
-
export declare function schemaSearchParams<A, I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
31
|
-
...P,
|
|
32
|
-
Route.Route.Route<{}, {
|
|
33
|
-
searchParams: A;
|
|
34
|
-
}, unknown, ParseResult.ParseError, R>
|
|
35
|
-
]>;
|
|
36
|
-
export declare function schemaPathParams<A, I extends Readonly<Record<string, string | undefined>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
37
|
-
...P,
|
|
38
|
-
Route.Route.Route<{}, {
|
|
39
|
-
pathParams: A;
|
|
40
|
-
}, unknown, ParseResult.ParseError, R>
|
|
41
|
-
]>;
|
|
42
|
-
export declare function schemaBodyJson<A, I, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
43
|
-
...P,
|
|
44
|
-
Route.Route.Route<{}, {
|
|
45
|
-
body: A;
|
|
46
|
-
}, unknown, RequestBodyError | ParseResult.ParseError, R>
|
|
47
|
-
]>;
|
|
48
|
-
export declare function schemaBodyUrlParams<A, I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
49
|
-
...P,
|
|
50
|
-
Route.Route.Route<{}, {
|
|
51
|
-
body: A;
|
|
52
|
-
}, unknown, RequestBodyError | ParseResult.ParseError, R>
|
|
53
|
-
]>;
|
|
54
|
-
export declare function schemaBodyMultipart<A, I extends Partial<Record<string, ReadonlyArray<Http.FilePart> | ReadonlyArray<string> | string>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
55
|
-
...P,
|
|
56
|
-
Route.Route.Route<{}, {
|
|
57
|
-
body: A;
|
|
58
|
-
}, unknown, RequestBodyError | ParseResult.ParseError, R | Scope.Scope>
|
|
59
|
-
]>;
|
|
60
|
-
export declare function schemaBodyForm<A, I extends Partial<Record<string, ReadonlyArray<Http.FilePart> | ReadonlyArray<string> | string>>, R>(fields: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
61
|
-
...P,
|
|
62
|
-
Route.Route.Route<{}, {
|
|
63
|
-
body: A;
|
|
64
|
-
}, unknown, RequestBodyError | ParseResult.ParseError, R | Scope.Scope>
|
|
65
|
-
]>;
|
|
66
|
-
/**
|
|
67
|
-
* Intercepts typed errors from downstream handlers, encodes them through the
|
|
68
|
-
* schema, and returns a JSON response with the given status code.
|
|
69
|
-
*
|
|
70
|
-
* Without `schemaError`, handler errors fall through to global catch during
|
|
71
|
-
* execution of request. `schemaError` short circuts error handling by
|
|
72
|
-
* return an error response immedietly.
|
|
73
|
-
*
|
|
74
|
-
* TODO: store the errors in runtime to enable generating OpenAPI and other
|
|
75
|
-
* goodies.
|
|
76
|
-
*/
|
|
77
|
-
export declare function schemaError<A, I, R>(schema: Schema.Schema<A, I, R> & {
|
|
78
|
-
readonly status: number;
|
|
79
|
-
}): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [...P, Route.Route.Route<{}, {}, unknown, never, R>]>;
|
|
80
|
-
export declare function schemaError<A, I, R>(schema: Schema.Schema<A, I, R>, options: {
|
|
81
|
-
readonly status: number;
|
|
82
|
-
}): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [...P, Route.Route.Route<{}, {}, unknown, never, R>]>;
|
|
83
|
-
export declare function schemaSuccess<A, I, R>(schema: Schema.Schema<A, I, R>): <D extends Route.RouteDescriptor.Any, SB extends {}, P extends Route.Route.Tuple>(self: Route.RouteSet.RouteSet<D, SB, P>) => Route.RouteSet.RouteSet<D, SB, [
|
|
84
|
-
...P,
|
|
85
|
-
Route.Route.Route<{}, {}, I, ParseResult.ParseError, R>
|
|
86
|
-
]>;
|
package/dist/RouteSse.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Stream from "effect/Stream";
|
|
3
|
-
import type * as Utils from "effect/Utils";
|
|
4
|
-
import * as Entity from "./Entity.ts";
|
|
5
|
-
import * as Route from "./Route.ts";
|
|
6
|
-
import type * as Values from "./Values.ts";
|
|
7
|
-
export interface SseEvent {
|
|
8
|
-
data?: string | undefined;
|
|
9
|
-
event?: string;
|
|
10
|
-
retry?: number;
|
|
11
|
-
}
|
|
12
|
-
export type SseTaggedEvent = {
|
|
13
|
-
readonly _tag: string;
|
|
14
|
-
};
|
|
15
|
-
export type SseEventInput = SseEvent | SseTaggedEvent;
|
|
16
|
-
export type SseHandlerInput<B, E, R> = Stream.Stream<SseEventInput, E, R> | Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R> | ((context: Values.Simplify<B>, next: (context?: Partial<B> & Record<string, unknown>) => Entity.Entity<string>) => Stream.Stream<SseEventInput, E, R> | Effect.Effect<Stream.Stream<SseEventInput, E, R>, E, R> | Generator<Utils.YieldWrap<Effect.Effect<unknown, E, R>>, Stream.Stream<SseEventInput, E, R>, unknown>);
|
|
17
|
-
export declare function sse<D extends Route.RouteDescriptor.Any, B extends {}, I extends Route.Route.Tuple, E = never, R = never>(handler: SseHandlerInput<NoInfer<D & B & Route.ExtractBindings<I> & {
|
|
18
|
-
format: "text";
|
|
19
|
-
}>, E, R>): (self: Route.RouteSet.RouteSet<D, B, I>) => Route.RouteSet.RouteSet<D, B, [...I, Route.Route.Route<{
|
|
20
|
-
format: "text";
|
|
21
|
-
}, {}, Stream.Stream<string, E, R>, E, R>]>;
|
package/dist/RouteTree.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as PathPattern from "./PathPattern.ts";
|
|
2
|
-
import * as Route from "./Route.ts";
|
|
3
|
-
import type * as RouteMount from "./RouteMount.ts";
|
|
4
|
-
declare const TypeId: unique symbol;
|
|
5
|
-
declare const RouteTreeRoutes: unique symbol;
|
|
6
|
-
type MethodRoute = Route.Route.With<{
|
|
7
|
-
method: string;
|
|
8
|
-
}>;
|
|
9
|
-
export type RouteTuple = Iterable<MethodRoute>;
|
|
10
|
-
export type LayerRoute = Iterable<Route.Route.With<{
|
|
11
|
-
method: "*";
|
|
12
|
-
}>>;
|
|
13
|
-
type LayerKey = "*";
|
|
14
|
-
declare const LayerKey: LayerKey;
|
|
15
|
-
export type InputRouteMap = {
|
|
16
|
-
[LayerKey]?: LayerRoute;
|
|
17
|
-
} & {
|
|
18
|
-
[path: PathPattern.PathPattern]: RouteTuple | RouteTree;
|
|
19
|
-
};
|
|
20
|
-
export type RouteMap = {
|
|
21
|
-
[path: PathPattern.PathPattern]: Route.Route.Tuple;
|
|
22
|
-
};
|
|
23
|
-
export type Routes<T extends RouteTree> = T[typeof RouteTreeRoutes];
|
|
24
|
-
export interface RouteTree<Routes extends RouteMap = RouteMap> {
|
|
25
|
-
[TypeId]: typeof TypeId;
|
|
26
|
-
[RouteTreeRoutes]: Routes;
|
|
27
|
-
}
|
|
28
|
-
type PrefixKeys<T, Prefix extends string> = {
|
|
29
|
-
[K in keyof T as K extends string ? `${Prefix}${K}` : never]: T[K];
|
|
30
|
-
};
|
|
31
|
-
type InferItems<T> = T extends Route.RouteSet.Data<any, any, infer M> ? M : [];
|
|
32
|
-
type LayerItems<T extends InputRouteMap> = "*" extends keyof T ? InferItems<T["*"]> : [];
|
|
33
|
-
type FlattenRouteMap<T extends InputRouteMap> = {
|
|
34
|
-
[K in Exclude<keyof T, "*"> as T[K] extends RouteTree ? never : K]: [
|
|
35
|
-
...LayerItems<T>,
|
|
36
|
-
...InferItems<T[K]>
|
|
37
|
-
];
|
|
38
|
-
} & UnionToIntersection<FlattenNested<T, Exclude<keyof T, "*">, LayerItems<T>>>;
|
|
39
|
-
type FlattenNested<T, K, L extends Route.Route.Tuple> = K extends keyof T ? T[K] extends RouteTree<infer R> ? PrefixKeys<PrependLayers<R, L>, K & string> : {} : {};
|
|
40
|
-
type PrependLayers<T extends RouteMap, L extends Route.Route.Tuple> = {
|
|
41
|
-
[K in keyof T]: T[K] extends Route.Route.Tuple ? [...L, ...T[K]] : never;
|
|
42
|
-
};
|
|
43
|
-
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
44
|
-
export declare function make<const Routes extends InputRouteMap>(input: Routes): RouteTree<FlattenRouteMap<Routes>>;
|
|
45
|
-
export type WalkDescriptor = {
|
|
46
|
-
path: PathPattern.PathPattern;
|
|
47
|
-
method: string;
|
|
48
|
-
} & Route.RouteDescriptor.Any;
|
|
49
|
-
export declare function walk(tree: RouteTree): Generator<RouteMount.MountedRoute>;
|
|
50
|
-
export declare function merge(a: RouteTree, b: RouteTree): RouteTree;
|
|
51
|
-
export declare function isRouteTree(input: unknown): input is RouteTree;
|
|
52
|
-
export interface LookupResult {
|
|
53
|
-
route: RouteMount.MountedRoute;
|
|
54
|
-
params: Record<string, string>;
|
|
55
|
-
}
|
|
56
|
-
export declare function lookup(tree: RouteTree, method: string, path: string): LookupResult | null;
|
|
57
|
-
export {};
|
package/dist/RouteTrie.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as Route from "./Route.ts";
|
|
2
|
-
export interface Node {
|
|
3
|
-
children: Record<string, Node>;
|
|
4
|
-
paramChild: Node | null;
|
|
5
|
-
paramName: string | null;
|
|
6
|
-
requiredWildcardChild: Node | null;
|
|
7
|
-
requiredWildcardName: string | null;
|
|
8
|
-
optionalWildcardChild: Node | null;
|
|
9
|
-
optionalWildcardName: string | null;
|
|
10
|
-
routes: Array<Route.Route.Route>;
|
|
11
|
-
}
|
|
12
|
-
export interface RouteTrie {
|
|
13
|
-
readonly methods: Record<string, Node>;
|
|
14
|
-
}
|
|
15
|
-
export interface LookupResult {
|
|
16
|
-
route: Route.Route.Route;
|
|
17
|
-
params: Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
export declare function make(set: Route.RouteSet.Any): RouteTrie;
|
|
20
|
-
export declare function lookup(trie: RouteTrie, method: string, path: string): Array<LookupResult>;
|