forked from alexziskind1/nativescript-oauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated typescript definitions and references
- Loading branch information
1 parent
801d05f
commit 6140ecc
Showing
20 changed files
with
175 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
demo/ | ||
node_modules/ | ||
hooks/ | ||
*.png | ||
*.log | ||
*.log | ||
*.ts | ||
*.js.map | ||
tsconfig.json | ||
|
||
!index.d.ts | ||
!tns-oauth-interfaces.d.ts | ||
!*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
/// <reference path="demo/node_modules/tns-core-modules/es6-promise.d.ts" /> | ||
/// <reference path="./tns-oauth-interfaces.d.ts" /> | ||
|
||
declare module "nativescript-oauth" { | ||
export function initOffice365(options: TnsOAuth.ITnsOAuthOptionsOffice365): Promise<any>; | ||
export function initFacebook(options: TnsOAuth.ITnsOAuthOptionsFacebook): Promise<any>; | ||
export function initGoogle(options: TnsOAuth.ITnsOAuthOptionsGoogle): Promise<any>; | ||
import * as TnsOAuth from './tns-oauth-interfaces'; | ||
export * from './tns-oauth-interfaces'; | ||
|
||
export function accessToken() : string; | ||
export function login(successPage?: string) : Promise<string>; | ||
export function logout(successPage: string) : Promise<any>; | ||
export function accessTokenExpired() : boolean; | ||
export function ensureValidToken() : Promise<string>; | ||
} | ||
export declare var instance: TnsOAuth.ITnsAuthHelper; | ||
export declare function initOffice365(options: TnsOAuth.ITnsOAuthOptionsOffice365): Promise<any>; | ||
export declare function initFacebook(options: TnsOAuth.ITnsOAuthOptionsFacebook): Promise<any>; | ||
export declare function initGoogle(options: TnsOAuth.ITnsOAuthOptionsGoogle): Promise<any>; | ||
export declare function accessToken(): string; | ||
export declare function login(successPage?: string): Promise<string>; | ||
export declare function logout(successPage: string): Promise<any>; | ||
export declare function accessTokenExpired(): boolean; | ||
export declare function ensureValidToken(): Promise<string>; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "nativescript-oauth", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "OAuth 2 login for NativeScript.", | ||
"main": "index.js", | ||
"nativescript": { | ||
|
@@ -20,6 +20,10 @@ | |
"type": "git", | ||
"url": "https://github.com/alexziskind1/nativescript-oauth.git" | ||
}, | ||
"typescript": { | ||
"definition": "index.d.ts" | ||
}, | ||
"typings": "index", | ||
"keywords": [ | ||
"NativeScript", | ||
"JavaScript", | ||
|
@@ -33,13 +37,13 @@ | |
"author": { | ||
"name": "Alexander Ziskind", | ||
"email": "[email protected]", | ||
"url" : "http://www.nuvious.com/blog" | ||
"url": "http://www.nuvious.com/blog" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Kevin Primm", | ||
"email": "[email protected]", | ||
"url" : "http://primm.me/" | ||
"url": "https://github.com/kfprimm" | ||
} | ||
], | ||
"bugs": { | ||
|
@@ -52,12 +56,12 @@ | |
"homepage": "https://github.com/alexziskind1/nativescript-oauth", | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"querystring": "^0.2.0", | ||
"url": "^0.11.0" | ||
"url": "^0.11.0", | ||
"querystring": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^1.8.10", | ||
"nativescript-dev-typescript": "^0.3.0", | ||
"tns-core-modules": "^2.1.0", | ||
"nativescript-dev-typescript": "^0.3.0" | ||
"typescript": "^1.8.10" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" /> Needed for autocompletion and compilation. | ||
/// <reference path="demo/node_modules/tns-core-modules/tns-core-modules.d.ts" /> | ||
/// <reference path="demo/node_modules/tns-platform-declarations/tns-core-modules/android17.d.ts" /> | ||
/// <reference path="demo/node_modules/tns-platform-declarations/tns-core-modules/ios.d.ts" /> | ||
/// <reference path="demo/node_modules/tns-platform-declarations/tns-core-modules/org.nativescript.widgets.d.ts" /> | ||
/// <reference path="./index.d.ts" /> | ||
/// <reference path="./typings/url.d.ts" /> | ||
/// <reference path="./typings/querystring.d.ts" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
|
||
declare module TnsOAuth { | ||
interface ITnsAuthHelper { | ||
credentials: ITnsOAuthCredentials; | ||
tokenResult: ITnsOAuthTokenResult; | ||
login: (successPage?: string) => Promise<string>; | ||
logout: (successPage: string) => Promise<{}>; | ||
refreshToken: () => Promise<string>; | ||
accessTokenExpired: () => boolean; | ||
refreshTokenExpired: () => boolean; | ||
} | ||
|
||
interface ITnsOAuthCredentials { | ||
authority: string; | ||
tokenEndpointBase?: string; | ||
authorizeEndpoint: string; | ||
tokenEndpoint: string; | ||
clientId: string; | ||
clientSecret?: string; | ||
redirectUri: string; | ||
scope: string; | ||
} | ||
|
||
interface ITnsOAuthTokenResult { | ||
accessToken: string; | ||
refreshToken: string; | ||
accessTokenExpiration: Date; | ||
refreshTokenExpiration: Date; | ||
} | ||
|
||
interface ITnsOAuthOptions { | ||
clientId: string; | ||
scope: string[]; | ||
} | ||
|
||
interface ITnsOAuthOptionsOffice365 extends ITnsOAuthOptions { | ||
} | ||
|
||
interface ITnsOAuthOptionsFacebook extends ITnsOAuthOptions { | ||
clientSecret: string; | ||
} | ||
|
||
interface ITnsOAuthOptionsGoogle extends ITnsOAuthOptions { | ||
} | ||
|
||
|
||
export interface ITnsAuthHelper { | ||
credentials: ITnsOAuthCredentials; | ||
tokenResult: ITnsOAuthTokenResult; | ||
login: (successPage?: string) => Promise<string>; | ||
logout: (successPage: string) => Promise<{}>; | ||
refreshToken: () => Promise<string>; | ||
accessTokenExpired: () => boolean; | ||
refreshTokenExpired: () => boolean; | ||
} | ||
|
||
export interface ITnsOAuthCredentials { | ||
authority: string; | ||
tokenEndpointBase?: string; | ||
authorizeEndpoint: string; | ||
tokenEndpoint: string; | ||
clientId: string; | ||
clientSecret?: string; | ||
redirectUri: string; | ||
scope: string; | ||
} | ||
|
||
export interface ITnsOAuthTokenResult { | ||
accessToken: string; | ||
refreshToken: string; | ||
accessTokenExpiration: Date; | ||
refreshTokenExpiration: Date; | ||
} | ||
|
||
export interface ITnsOAuthOptions { | ||
clientId: string; | ||
scope: string[]; | ||
} | ||
|
||
export interface ITnsOAuthOptionsOffice365 extends ITnsOAuthOptions { | ||
} | ||
|
||
export interface ITnsOAuthOptionsFacebook extends ITnsOAuthOptions { | ||
clientSecret: string; | ||
} | ||
|
||
export interface ITnsOAuthOptionsGoogle extends ITnsOAuthOptions { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.