@workers-community/workers-types 4.20250924.0 → 4.20250927.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/index.d.ts +11 -16
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -8498,6 +8498,17 @@ interface MediaError extends Error {
|
|
|
8498
8498
|
readonly message: string;
|
|
8499
8499
|
readonly stack?: string;
|
|
8500
8500
|
}
|
|
8501
|
+
declare module "cloudflare:node" {
|
|
8502
|
+
interface NodeStyleServer {
|
|
8503
|
+
listen(...args: unknown[]): this;
|
|
8504
|
+
address(): {
|
|
8505
|
+
port?: number | null | undefined;
|
|
8506
|
+
};
|
|
8507
|
+
}
|
|
8508
|
+
export function httpServerHandler(port: number): ExportedHandler;
|
|
8509
|
+
export function httpServerHandler(options: { port: number }): ExportedHandler;
|
|
8510
|
+
export function httpServerHandler(server: NodeStyleServer): ExportedHandler;
|
|
8511
|
+
}
|
|
8501
8512
|
type Params<P extends string = any> = Record<P, string | string[]>;
|
|
8502
8513
|
type EventContext<Env, P extends string, Data> = {
|
|
8503
8514
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
@@ -8843,22 +8854,6 @@ declare namespace Cloudflare {
|
|
|
8843
8854
|
: {});
|
|
8844
8855
|
};
|
|
8845
8856
|
}
|
|
8846
|
-
declare module "cloudflare:node" {
|
|
8847
|
-
export interface DefaultHandler {
|
|
8848
|
-
fetch?(request: Request): Response | Promise<Response>;
|
|
8849
|
-
tail?(events: TraceItem[]): void | Promise<void>;
|
|
8850
|
-
trace?(traces: TraceItem[]): void | Promise<void>;
|
|
8851
|
-
scheduled?(controller: ScheduledController): void | Promise<void>;
|
|
8852
|
-
queue?(batch: MessageBatch<unknown>): void | Promise<void>;
|
|
8853
|
-
test?(controller: TestController): void | Promise<void>;
|
|
8854
|
-
}
|
|
8855
|
-
export function httpServerHandler(
|
|
8856
|
-
options: {
|
|
8857
|
-
port: number;
|
|
8858
|
-
},
|
|
8859
|
-
handlers?: Omit<DefaultHandler, "fetch">,
|
|
8860
|
-
): DefaultHandler;
|
|
8861
|
-
}
|
|
8862
8857
|
declare namespace CloudflareWorkersModule {
|
|
8863
8858
|
export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>;
|
|
8864
8859
|
export const RpcStub: {
|