DefinitelyTyped/types/angular-oauth2/index.d.ts
Nathan Shively-Sanders f0ce987bc1 Update project urls to match NPM url
Note that this *trivially* updates project urls by adding the NPM url to
the end, even when the urls are almost identical or the DT one is
outdated. I'll clean up the urls in a later commit.

This PR is unfinished! Please do not merge it yet.
2019-02-11 17:10:55 -08:00

49 lines
1.4 KiB
TypeScript

// Type definitions for angular-oauth2 4.1
// Project: https://github.com/oauthjs/angular-oauth2, https://github.com/seegno/angular-oauth2
// Definitions by: Antério Vieira <https://github.com/anteriovieira>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as angular from 'angular';
declare module 'angular' {
namespace oauth2 {
interface OAuthConfig {
baseUrl: string;
clientId: string;
clientSecret?: string;
grantPath?: string;
revokePath?: string;
}
interface OAuthProvider {
configure(params: OAuthConfig): OAuthConfig;
}
interface Data {
username: string;
password: string;
}
interface OAuth {
isAuthenticated(): boolean;
getAccessToken(data: Data, options?: any): IPromise<string>;
getRefreshToken(data?: Data, options?: any): IPromise<string>;
revokeToken(data?: Data, options?: any): IPromise<string>;
}
interface OAuthTokenConfig {
name: string;
options: any;
}
interface OAuthTokenOptions {
secure: boolean;
}
interface OAuthTokenProvider {
configure(params: OAuthTokenConfig): OAuthTokenConfig;
}
}
}