Skip to content

Commit

Permalink
chore(types): update types
Browse files Browse the repository at this point in the history
  • Loading branch information
reboxer committed Apr 20, 2020
1 parent e94d0c3 commit 4b37b96
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,30 @@ interface PartialGuild {
}

declare class OAuth extends EventEmitter {
constructor(options?: {
constructor(opts?: {
clientId?: string,
redirectUri?: string,
credentials?: string,
clientSecret?: string,
requestTimeout?: number,
latencyThreshold?: number,
ratelimiterOffset?: number,
});
on(event: "debug" | "warn", listener: (message: string) => void): this;
tokenRequest(data: {
tokenRequest(opts: {
code?: string,
scope: string,
clientId: string,
scope: string[] | string,
clientId?: string,
grantType: "authorization_code" | "refresh_token",
redirectUri: string,
redirectUri?: string,
refreshToken?: string,
clientSecret: string,
clientSecret?: string,
}): Promise<TokenRequestResult>;
revokeToken(access_token: string, credentials: string): Promise<string>;
revokeToken(access_token: string, credentials?: string): Promise<string>;
getUser(access_token: string): Promise<User>;
getUserGuilds(access_token: string): Promise<PartialGuild[]>;
getUserConnections(access_token: string): Promise<Connection[]>;
addMember(data: {
addMember(opts: {
deaf?: boolean,
mute?: boolean,
roles?: string[],
Expand All @@ -103,6 +106,13 @@ declare class OAuth extends EventEmitter {
botToken: string,
accessToken: string,
}): Promise<Member>;
generateAuthUrl(opts: {
scope: string[] | string,
state?: string,
clientId?: string,
redirectUri?: string,
responseType?: "code" | "token",
})
}

export = OAuth;

0 comments on commit 4b37b96

Please sign in to comment.