|
1 | 1 | import { UserDetectionStatus } from './common'; |
2 | 2 | import { View } from '@nativescript/core'; |
3 | 3 |
|
4 | | -export class SignInButton extends View { } |
5 | | - |
| 4 | +export type SignInButtonType = 'default' | 'signUp' | 'continue'; |
| 5 | +export type SignInButtonStyle = 'white' | 'whiteOutline' | 'black'; |
| 6 | + |
| 7 | +export class SignInButton extends View { |
| 8 | + /** |
| 9 | + * Button type: 'default' (Sign in with Apple), 'signUp' (Sign up with Apple), 'continue' (Continue with Apple) |
| 10 | + */ |
| 11 | + type: SignInButtonType; |
| 12 | + /** |
| 13 | + * Button style: 'white', 'whiteOutline', 'black' |
| 14 | + */ |
| 15 | + buttonStyle: SignInButtonStyle; |
| 16 | +} |
6 | 17 |
|
7 | | -export type SignInScopes = "EMAIL" | "FULL_NAME"; |
| 18 | +export type SignInScopes = 'EMAIL' | 'FULL_NAME'; |
8 | 19 |
|
9 | 20 | export interface SignInOptions { |
10 | | - user?: string; |
11 | | - scopes?: SignInScopes[], |
12 | | - useNonce?: boolean, |
13 | | - nonce?: string |
| 21 | + user?: string; |
| 22 | + scopes?: SignInScopes[]; |
| 23 | + useNonce?: boolean; |
| 24 | + nonce?: string; |
14 | 25 | } |
15 | 26 |
|
16 | 27 | export interface UserFullName { |
17 | | - namePrefix?: string, |
18 | | - givenName?: string, |
19 | | - middleName?: string, |
20 | | - familyName?: string, |
21 | | - nameSuffix?: string, |
22 | | - nickname?: string |
| 28 | + namePrefix?: string; |
| 29 | + givenName?: string; |
| 30 | + middleName?: string; |
| 31 | + familyName?: string; |
| 32 | + nameSuffix?: string; |
| 33 | + nickname?: string; |
23 | 34 | } |
24 | 35 |
|
25 | 36 | export interface User { |
26 | | - nonce?: string, |
27 | | - user: string, |
28 | | - fullName?: UserFullName, |
29 | | - realUserStatus: UserDetectionStatus, |
30 | | - authorizedScopes: SignInScopes[], |
31 | | - identityToken?: string, |
32 | | - email?: string, |
33 | | - state: string, |
34 | | - authorizationCode?: string |
| 37 | + nonce?: string; |
| 38 | + user: string; |
| 39 | + fullName?: UserFullName; |
| 40 | + realUserStatus: UserDetectionStatus; |
| 41 | + authorizedScopes: SignInScopes[]; |
| 42 | + identityToken?: string; |
| 43 | + email?: string; |
| 44 | + state: string; |
| 45 | + authorizationCode?: string; |
35 | 46 | } |
36 | 47 |
|
37 | 48 | export class SignIn { |
38 | | - static #controller: ASAuthorizationController; |
39 | | - static #delegate: ASAuthorizationControllerDelegate; |
| 49 | + static #controller: ASAuthorizationController; |
| 50 | + static #delegate: ASAuthorizationControllerDelegate; |
40 | 51 |
|
41 | | - public static signIn( |
42 | | - options?: SignInOptions |
43 | | - ): Promise<User>; |
| 52 | + public static signIn(options?: SignInOptions): Promise<User>; |
44 | 53 |
|
45 | | - public static isSupported(): boolean; |
| 54 | + public static isSupported(): boolean; |
46 | 55 |
|
47 | | - public static getState(userID: string): Promise<CredentialState>; |
| 56 | + public static getState(userID: string): Promise<CredentialState>; |
48 | 57 | } |
0 commit comments