Skip to content

Commit

Permalink
Use typescript isolatedDeclarations.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 4, 2025
1 parent 8fab53e commit 0d731e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 10 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,18 @@ export class JsonrpcProvider implements JsonrpcInterface {
if (json && json.error) throw this.jsonError(json.error);
return json.result;
}
call(method: string, ...args: any[]) {
call(method: string, ...args: any[]): Promise<any> {
return this.rpc(method, args);
}
callNamed(method: string, params: Record<string, any>) {
callNamed(method: string, params: Record<string, any>): Promise<any> {
return this.rpc(method, params);
}
}
export function jsonrpc(fetchFunction: FetchFn, rpcUrl: string, options: NetworkOpts = {}) {
export function jsonrpc(
fetchFunction: FetchFn,
rpcUrl: string,
options: NetworkOpts = {}
): JsonrpcProvider {
return new JsonrpcProvider(fetchFunction, rpcUrl, options);
}

Expand Down Expand Up @@ -381,6 +385,8 @@ export function replayable(
}

// Internal methods for test purposes only
export const _TEST = /* @__PURE__ */ {
export const _TEST: {
limit: typeof limit;
} = /* @__PURE__ */ {
limit,
};
3 changes: 2 additions & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"lib": ["es2019", "dom"],
"module": "es2020",
"moduleResolution": "bundler",
"outDir": "lib/esm"
"outDir": "lib/esm",
"isolatedDeclarations": true
},
"include": ["index.ts"],
"exclude": ["node_modules", "lib"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "@paulmillr/jsbt/tsconfig.cjs.json",
"compilerOptions": {
"lib": ["es2019", "dom"],
"outDir": "lib"
"outDir": "lib",
"isolatedDeclarations": true
},
"include": ["index.ts"],
"exclude": ["node_modules", "lib"]
Expand Down

0 comments on commit 0d731e7

Please sign in to comment.