Skip to content

Commit

Permalink
fix: api method type (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
theteladras authored Dec 3, 2023
1 parent ac399ec commit 75813a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions types/client-api.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface ClientApi {
* Placeholders may be used, which will be substituted by the variables object passed within the options.
* @param options
*/
api(query: string, options?: APIOptions): Promise<{ data: object }>;
api<T = any>(query: string, options?: APIOptions): Promise<{ data: T, account_id: number }>;

/**
* Instead of passing the API token to the `api()` method on each request, you can set the API token once using:
Expand All @@ -58,4 +58,4 @@ export interface ClientApi {
* @param object An object with options
*/
oauth(object?: OAuthOptions): void;
}
}
2 changes: 1 addition & 1 deletion types/server-sdk.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface MondayServerSdk {

setApiVersion(version: string): void;

api(query: string, options?: APIOptions): Promise<any>;
api<T = any>(query: string, options?: APIOptions): Promise<T>;

oauthToken(code: string, clientId: string, clientSecret: string): Promise<any>;
}

0 comments on commit 75813a3

Please sign in to comment.