Skip to content

Commit 4154a43

Browse files
authored
fix: misc types (#719)
1 parent 4545323 commit 4154a43

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

examples/scripts/reconnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { waitFor } from '@dedot/utils/dist/index.js';
1+
import { waitFor } from '@dedot/utils';
22
import { DedotClient, WsProvider } from 'dedot';
33

44
const provider = new WsProvider({

packages/api/src/client/DedotClient.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ export type ClientOptions = ApiOptions & {
8787
*/
8888
export class DedotClient<
8989
ChainApi extends GenericSubstrateApi = SubstrateApi, // --
90-
> implements ISubstrateClient<ChainApi, ApiEvent>
91-
{
90+
> implements ISubstrateClient<ChainApi, ApiEvent> {
9291
#client: ISubstrateClient<ChainApi, ApiEvent>;
9392
/** The JSON-RPC version being used ('v2' or 'legacy') */
9493
rpcVersion: RpcVersion;
@@ -398,7 +397,7 @@ export class DedotClient<
398397
* @param handler - The handler function to remove (optional, removes all handlers if not provided)
399398
* @returns This client instance for method chaining
400399
*/
401-
off(event: ApiEvent, handler?: ((...args: any[]) => void) | undefined): this {
400+
off<Event extends ApiEvent = ApiEvent>(event: Event, handler?: EventHandlerFn<Event>): this {
402401
this.#client.off(event, handler);
403402
return this;
404403
}

0 commit comments

Comments
 (0)