Skip to content

Commit

Permalink
Added lint types
Browse files Browse the repository at this point in the history
  • Loading branch information
Kshitij-Katiyar committed Jul 15, 2024
1 parent 64b28bc commit 64b4385
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions webapp/src/client/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {Client4} from 'mattermost-redux/client';
import {ClientError} from 'mattermost-redux/client/client4';

import {Options} from 'mattermost-redux/types/client4';

import {Item, TooltipData} from 'src/types/gitlab_items';
import {APIError, ConnectedData, GitlabUsersData, LHSData, SubscriptionData} from 'src/types';

Expand Down Expand Up @@ -39,10 +41,10 @@ export default class Client {
return this.doGet<SubscriptionData>(`${this.url}/channel/${channelID}/subscriptions`);
};

private async doGet<Response>(url: string, headers: Record<string, unknown> = {}): Promise<Response | APIError> {
headers['X-Timezone-Offset'] = new Date().getTimezoneOffset();
private async doGet<Response>(url: string, headers: { [x: string]: string; } = {}): Promise<Response > {
headers['X-Timezone-Offset'] = String(new Date().getTimezoneOffset());

const options = {
const options: Options = {
method: 'get',
headers,
};
Expand All @@ -62,10 +64,10 @@ export default class Client {
});
}

private async doPost<Response>(url: string, body: Object, headers: Record<string, unknown> = {}): Promise<Response | APIError> {
headers['X-Timezone-Offset'] = new Date().getTimezoneOffset();
private async doPost<Response>(url: string, body: Object, headers: { [x: string]: string; } = {}): Promise<Response > {
headers['X-Timezone-Offset'] = String(new Date().getTimezoneOffset());

const options = {
const options: Options = {
method: 'post',
body: JSON.stringify(body),
headers,
Expand All @@ -86,10 +88,10 @@ export default class Client {
});
}

private async doDelete<Response>(url: string, headers: Record<string, unknown> = {}): Promise<Response | APIError> {
headers['X-Timezone-Offset'] = new Date().getTimezoneOffset();
private async doDelete<Response>(url: string, headers: { [x: string]: string; } = {}): Promise<Response > {
headers['X-Timezone-Offset'] = String(new Date().getTimezoneOffset());

const options = {
const options: Options = {
method: 'delete',
headers,
};
Expand All @@ -109,8 +111,8 @@ export default class Client {
});
}

private async doPut<Response>(url: string, body: Object, headers: Record<string, unknown> = {}): Promise<Response | APIError> {
headers['X-Timezone-Offset'] = new Date().getTimezoneOffset();
private async doPut<Response>(url: string, body: Object, headers: { [x: string]: string; } = {}): Promise<Response > {
headers['X-Timezone-Offset'] = String(new Date().getTimezoneOffset());

const options = {
method: 'put',
Expand Down

0 comments on commit 64b4385

Please sign in to comment.