Skip to content

Commit

Permalink
Fix: handle import type via extra type file
Browse files Browse the repository at this point in the history
  • Loading branch information
NobleMajo committed Jan 18, 2025
1 parent 39c617a commit 9443d6f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bun-route",
"version": "1.1.0",
"version": "1.1.1",
"description": "A fast, Express-like router for the high-performance bun.serve() HTTP server.",
"type": "module",
"main": "./dist/index.cjs",
Expand Down
1 change: 1 addition & 0 deletions src/request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type BunRequest = Request
2 changes: 1 addition & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type Server } from "bun"
import { statSync } from "fs"
import { join } from "path"
import type { Request as BunRequest } from "undici-types"
import { HttpMethod, parseHttpMethods, stringifyHttpMethods, type HttpMethodString } from "./method"
import { isMergeableEndpointRoute, isMergedRequestMiddleware, mergeRequestMiddlewares, unmergeRequestMiddleware, } from "./middleware"
import { BunRequest } from "./request"
import { ResponseBuilder } from "./responseBuilder"
import type { Awaitable, BunRequestHandler, EndpointRoute, Request, RequestMiddleware } from "./types"

Expand Down
3 changes: 1 addition & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { type Server, type SocketAddress } from "bun"
import type { Request as BunRequest } from "undici-types"
import { type HttpMethod } from "./method"
import { BunRequest } from "./request"
import type { ResponseBuilder } from "./responseBuilder"
import { SplitPath } from "./router"

export type Awaitable<T> = T | Promise<T>


export type Request = BunRequest & {
/**
* `req.pathParams` is the path parameters of the request.
Expand Down

0 comments on commit 9443d6f

Please sign in to comment.