mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
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.
49 lines
1.4 KiB
TypeScript
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;
|
|
}
|
|
}
|
|
}
|