bun-serve-express
Advanced tools
Comparing version 1.0.0 to 1.0.1
/// <reference types="bun-types" /> | ||
/// <reference types="qs" /> | ||
import Bun from "bun"; | ||
import Bun, { ServeOptions, TLSServeOptions, TLSWebSocketServeOptions, UnixServeOptions, UnixTLSServeOptions, UnixTLSWebSocketServeOptions, UnixWebSocketServeOptions, WebSocketServeOptions } from "bun"; | ||
import EventEmitter from "events"; | ||
@@ -11,4 +11,5 @@ import express, { NextFunction } from "express"; | ||
type EngineCallback = (path: string, options: object, callback: RenderCallback) => void; | ||
export type ApplicationOptions<T> = Partial<ServeOptions & TLSServeOptions & UnixServeOptions & UnixTLSServeOptions & WebSocketServeOptions<T> & TLSWebSocketServeOptions<T> & UnixWebSocketServeOptions<T> & UnixTLSWebSocketServeOptions<T>>; | ||
export declare class Application<T = any> extends EventEmitter { | ||
protected bunServeOptions: Partial<Bun.Serve<T>>; | ||
protected bunServeOptions: ApplicationOptions<T>; | ||
protected bunServer: Bun.Server; | ||
@@ -18,3 +19,3 @@ protected request: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>; | ||
private _router; | ||
constructor(bunServeOptions: Partial<Bun.Serve<T>>); | ||
constructor(bunServeOptions: ApplicationOptions<T>); | ||
protected init(): void; | ||
@@ -21,0 +22,0 @@ protected handle(req: any, res: any, callback?: any): void; |
@@ -1,5 +0,3 @@ | ||
/// <reference types="bun-types" /> | ||
import Bun from "bun"; | ||
import { Application } from "./Application"; | ||
export default function <T = any>(app?: Partial<Bun.Serve<T>>): Application<T>; | ||
import { Application, ApplicationOptions } from "./Application"; | ||
export default function <T = any>(app?: ApplicationOptions<T>): Application<T>; | ||
export { Application }; | ||
@@ -6,0 +4,0 @@ export { IncomingMessage } from "./IncomingMessage"; |
{ | ||
"name": "bun-serve-express", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Express API compatibility for Bun.serve()", | ||
"types": "build/index.d.ts", | ||
"main": "build/index.js", | ||
@@ -6,0 +7,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
1160504