Skip to content

Commit

Permalink
Merge pull request #5155 from LedgerHQ/support/custom-add-types
Browse files Browse the repository at this point in the history
refactor: add missing types for the wallet-api CustomLogger
  • Loading branch information
Justkant authored Oct 25, 2023
2 parents fb72a48 + 3ce4f6e commit 954b230
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-jeans-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

refactor: add missing types for the wallet-api CustomLogger
11 changes: 6 additions & 5 deletions libs/ledger-live-common/src/wallet-api/CustomLogger/client.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { CustomModule } from "@ledgerhq/wallet-api-client";
import { LoggerParams, LoggerResponse } from "./types";

export class CustomLogger extends CustomModule {
debug(message: string) {
return this.request("custom.logger.debug", { message });
return this.request<LoggerParams, LoggerResponse>("custom.logger.debug", { message });
}

error(message: string) {
return this.request("custom.logger.error", { message });
return this.request<LoggerParams, LoggerResponse>("custom.logger.error", { message });
}

info(message: string) {
return this.request("custom.logger.info", { message });
return this.request<LoggerParams, LoggerResponse>("custom.logger.info", { message });
}

log(message: string) {
return this.request("custom.logger.log", { message });
return this.request<LoggerParams, LoggerResponse>("custom.logger.log", { message });
}

warn(message: string) {
return this.request("custom.logger.warn", { message });
return this.request<LoggerParams, LoggerResponse>("custom.logger.warn", { message });
}
}

1 comment on commit 954b230

@vercel
Copy link

@vercel vercel bot commented on 954b230 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.