Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.

Commit 727883b

Browse files
committed
fix(client): specify fetch type signature explicitly
Refine the type of the fetch option and class property to a more precise function signature matching the standard fetch API. This improves type safety and clarity for custom fetch implementations.
1 parent b31977d commit 727883b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/client.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ export interface PistonOptions {
6767
* Custom fetch function (useful for testing).
6868
* @default globalThis.fetch
6969
*/
70-
fetch?: typeof fetch;
70+
fetch?: (
71+
input: string | URL | Request,
72+
init?: RequestInit,
73+
) => Promise<Response>;
7174
}
7275

7376
/**
@@ -88,7 +91,10 @@ export interface PistonOptions {
8891
*/
8992
export class Piston {
9093
private readonly baseUrl: string;
91-
private readonly fetch: typeof fetch;
94+
private readonly fetch: (
95+
input: string | URL | Request,
96+
init?: RequestInit,
97+
) => Promise<Response>;
9298

9399
/**
94100
* Create a Piston client.

0 commit comments

Comments
 (0)