Skip to content

Commit

Permalink
fix(rpc): export LeatherProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jun 3, 2024
1 parent ef7c9bc commit fb532a2
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/rpc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ export interface ListenFn {
(method: string, callback: () => void): () => void;
}

export interface LeatherProvider {
/**
* Request method. Takes a method name, and optional parameters
* @returns Typed response for corresponding method
*/
request: RequestFn;
/**
* Listen method. Takes an event name to listen for, and a callback function.
* @returns An unsubscribe function
*/
listen: ListenFn;
}

declare global {
interface Window {
LeatherProvider?: {
/**
* Request method. Takes a method name, and optional parameters
* @returns Typed response for corresponding method
*/
request: RequestFn;
/**
* Listen method. Takes an event name to listen for, and a callback function.
* @returns An unsubscribe function
*/
listen: ListenFn;
};
LeatherProvider?: LeatherProvider;
}
}

0 comments on commit fb532a2

Please sign in to comment.