Skip to content

[fix] Update type declarations #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,41 @@ export declare class AuthenticationObserver {
disconnect(): void
}

export declare function state(): Promise<any>
export declare function state(): Promise<unknown>
export declare function hasToken(): Promise<boolean>
export declare function token(): Promise<string>
export declare function token(): Promise<Token>
export declare function authorizationHeader(): Promise<string>
export declare function user(): Promise<any>
export declare function login(): Promise<any>
export declare function logout(): Promise<any>
export declare function refresh(mode?: string): Promise<any>
export declare function user(): Promise<User>
export declare function login(): Promise<unknown>
export declare function logout(): Promise<unknown>
export declare function refresh(mode?: string): Promise<unknown>

export interface UserNameObject {
displayName: string
familyName?: string
displayNamePosition?: string
givenName?: string
sortName?: string
}

export interface User {
email: string
byuId: string
netId: string
personId: string
name: UserNameObject
}

export interface TokenClient {
id: string
byuId: string
appName: string
}

export interface Token {
bearer: string
authorizationHeader: string
expiresAt: Date
client: TokenClient
rawUserInfo: Record<string, unknown>
}