Skip to content

Commit 1fcbfbb

Browse files
authored
Merge pull request #12 from stuft2/patch-1
[fix] Update type declarations
2 parents a85eb2e + 8308af9 commit 1fcbfbb

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

index.d.ts

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,41 @@ export declare class AuthenticationObserver {
2222
disconnect(): void
2323
}
2424

25-
export declare function state(): Promise<any>
25+
export declare function state(): Promise<unknown>
2626
export declare function hasToken(): Promise<boolean>
27-
export declare function token(): Promise<string>
27+
export declare function token(): Promise<Token>
2828
export declare function authorizationHeader(): Promise<string>
29-
export declare function user(): Promise<any>
30-
export declare function login(): Promise<any>
31-
export declare function logout(): Promise<any>
32-
export declare function refresh(mode?: string): Promise<any>
29+
export declare function user(): Promise<User>
30+
export declare function login(): Promise<unknown>
31+
export declare function logout(): Promise<unknown>
32+
export declare function refresh(mode?: string): Promise<unknown>
33+
34+
export interface UserNameObject {
35+
displayName: string
36+
familyName?: string
37+
displayNamePosition?: string
38+
givenName?: string
39+
sortName?: string
40+
}
41+
42+
export interface User {
43+
email: string
44+
byuId: string
45+
netId: string
46+
personId: string
47+
name: UserNameObject
48+
}
49+
50+
export interface TokenClient {
51+
id: string
52+
byuId: string
53+
appName: string
54+
}
55+
56+
export interface Token {
57+
bearer: string
58+
authorizationHeader: string
59+
expiresAt: Date
60+
client: TokenClient
61+
rawUserInfo: Record<string, unknown>
62+
}

0 commit comments

Comments
 (0)