@symbiote-native/apple-authentication 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +63 -2
- package/build/angular/apple-authentication-button/index.d.ts +12 -0
- package/build/angular/apple-authentication-button/index.js +98 -0
- package/build/angular/index.d.ts +2 -0
- package/build/angular/index.js +3 -0
- package/build/core/apple-authentication-button.d.ts +20 -0
- package/build/core/apple-authentication-button.js +28 -0
- package/build/core/apple-authentication.d.ts +34 -0
- package/build/core/apple-authentication.js +85 -0
- package/build/core/constants.d.ts +2 -0
- package/build/core/constants.js +3 -0
- package/build/core/index.d.ts +5 -0
- package/build/core/index.js +4 -0
- package/build/core/native-module.d.ts +10 -0
- package/build/core/native-module.js +8 -0
- package/build/core/types.d.ts +104 -0
- package/build/core/types.js +56 -0
- package/build/react/apple-authentication-button.d.ts +6 -0
- package/build/react/apple-authentication-button.js +7 -0
- package/build/react/index.d.ts +3 -0
- package/build/react/index.js +3 -0
- package/build/solid/apple-authentication-button.d.ts +3 -0
- package/build/solid/apple-authentication-button.js +4 -0
- package/build/solid/index.d.ts +3 -0
- package/build/solid/index.js +3 -0
- package/build/svelte/apple-authentication-button.svelte +17 -0
- package/build/svelte/apple-authentication-button.svelte.d.ts +4 -0
- package/build/svelte/index.d.ts +2 -0
- package/build/svelte/index.js +3 -0
- package/build/vue/apple-authentication-button.d.ts +3 -0
- package/build/vue/apple-authentication-button.js +15 -0
- package/build/vue/index.d.ts +3 -0
- package/build/vue/index.js +3 -0
- package/build-ngc/angular/apple-authentication-button/index.d.ts +15 -0
- package/build-ngc/angular/apple-authentication-button/index.js +48 -0
- package/build-ngc/angular/apple-authentication-button/index.js.map +1 -0
- package/build-ngc/angular/index.d.ts +2 -0
- package/build-ngc/angular/index.js +4 -0
- package/build-ngc/angular/index.js.map +1 -0
- package/build-ngc/core/apple-authentication-button.d.ts +20 -0
- package/build-ngc/core/apple-authentication-button.js +29 -0
- package/build-ngc/core/apple-authentication-button.js.map +1 -0
- package/build-ngc/core/apple-authentication.d.ts +34 -0
- package/build-ngc/core/apple-authentication.js +86 -0
- package/build-ngc/core/apple-authentication.js.map +1 -0
- package/build-ngc/core/constants.d.ts +2 -0
- package/build-ngc/core/constants.js +4 -0
- package/build-ngc/core/constants.js.map +1 -0
- package/build-ngc/core/index.d.ts +5 -0
- package/build-ngc/core/index.js +5 -0
- package/build-ngc/core/index.js.map +1 -0
- package/build-ngc/core/native-module.d.ts +10 -0
- package/build-ngc/core/native-module.js +9 -0
- package/build-ngc/core/native-module.js.map +1 -0
- package/build-ngc/core/types.d.ts +104 -0
- package/build-ngc/core/types.js +57 -0
- package/build-ngc/core/types.js.map +1 -0
- package/native-link.json +11 -0
- package/package.json +145 -3
- package/src/angular/apple-authentication-button/index.ts +35 -0
- package/src/angular/index.ts +28 -0
- package/src/core/apple-authentication-button.ts +69 -0
- package/src/core/apple-authentication.ts +127 -0
- package/src/core/constants.ts +5 -0
- package/src/core/index.ts +31 -0
- package/src/core/native-module.ts +38 -0
- package/src/core/types.ts +125 -0
- package/src/react/apple-authentication-button.ts +12 -0
- package/src/react/index.ts +28 -0
- package/src/solid/apple-authentication-button.ts +9 -0
- package/src/solid/index.ts +28 -0
- package/src/svelte/apple-authentication-button.svelte +17 -0
- package/src/svelte/index.ts +4 -0
- package/src/svelte/svelte-ambient.d.ts +3 -0
- package/src/svelte/svelte-compile.test-helper.ts +6 -0
- package/src/vue/apple-authentication-button.ts +18 -0
- package/src/vue/index.ts +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 A. Prokopenko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @symbiote-native/apple-authentication
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[`expo-apple-authentication`](https://docs.expo.dev/versions/latest/sdk/apple-authentication/) for
|
|
4
|
+
**every** [SymbioteNative](../../README.md) adapter: React, Vue, Svelte, Solid and Angular. Sign in
|
|
5
|
+
with Apple, iOS only: the credential flow and the system button.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @symbiote-native/cli new my-app --apple-authentication # new app
|
|
11
|
+
npx @symbiote-native/cli add --apple-authentication # existing app
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Manual: `npm install @symbiote-native/apple-authentication`, then wire `expo-modules-autolinking`
|
|
15
|
+
once per app. Never install `expo-apple-authentication` or the `expo` meta-package yourself.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import {
|
|
21
|
+
AppleAuthenticationButton,
|
|
22
|
+
AppleAuthenticationButtonStyle,
|
|
23
|
+
AppleAuthenticationButtonType,
|
|
24
|
+
AppleAuthenticationScope,
|
|
25
|
+
signInAsync,
|
|
26
|
+
} from '@symbiote-native/apple-authentication/react';
|
|
27
|
+
|
|
28
|
+
<AppleAuthenticationButton
|
|
29
|
+
buttonType={AppleAuthenticationButtonType.SIGN_IN}
|
|
30
|
+
buttonStyle={AppleAuthenticationButtonStyle.BLACK}
|
|
31
|
+
cornerRadius={8}
|
|
32
|
+
style={{ width: 200, height: 44 }}
|
|
33
|
+
onPress={async () => {
|
|
34
|
+
const credential = await signInAsync({
|
|
35
|
+
requestedScopes: [AppleAuthenticationScope.FULL_NAME, AppleAuthenticationScope.EMAIL],
|
|
36
|
+
});
|
|
37
|
+
}}
|
|
38
|
+
/>;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The functions (`isAvailableAsync`, `signInAsync`, `refreshAsync`, `signOutAsync`,
|
|
42
|
+
`getCredentialStateAsync`, `formatFullName`, `addRevokeListener`) and the enums are the same on
|
|
43
|
+
every adapter, they live in the shared core. The button takes `onPress`, `buttonType`,
|
|
44
|
+
`buttonStyle`, `cornerRadius`, `style` and the View surface. It needs a width and a height, and it
|
|
45
|
+
renders nothing off iOS (with a dev-only warning).
|
|
46
|
+
|
|
47
|
+
## App setup
|
|
48
|
+
|
|
49
|
+
The package declares what `expo-apple-authentication`'s config plugin adds, and the
|
|
50
|
+
`expo-modules-link` postinstall writes it into the app:
|
|
51
|
+
|
|
52
|
+
| File | Entry |
|
|
53
|
+
| ------------------ | ------------------------------------------------------------ |
|
|
54
|
+
| `Info.plist` | `CFBundleAllowMixedLocalizations = true`, for the localized button |
|
|
55
|
+
| `*.entitlements` | `com.apple.developer.applesignin = ['Default']` |
|
|
56
|
+
|
|
57
|
+
When the app has no `*.entitlements` file the postinstall creates `<App>/<App>.entitlements` next to
|
|
58
|
+
`Info.plist` and wires it into the Xcode project. Pick a signing Team in Xcode once; Sign in with
|
|
59
|
+
Apple does not work without one.
|
|
60
|
+
|
|
61
|
+
## Not ported
|
|
62
|
+
|
|
63
|
+
Nothing: the web build and the config plugin itself are replaced by the manifest above. Upstream
|
|
64
|
+
ships no tests, so the suites here are written against its behavior.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NativeViewBase } from '@symbiote-native/angular';
|
|
2
|
+
import type { IDescriptor } from '@symbiote-native/components';
|
|
3
|
+
import type { IAppleAuthenticationButtonProps } from '../../core/apple-authentication-button';
|
|
4
|
+
/** Angular twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
|
|
5
|
+
export declare class AppleAuthenticationButton extends NativeViewBase {
|
|
6
|
+
onPress: IAppleAuthenticationButtonProps['onPress'];
|
|
7
|
+
buttonType: IAppleAuthenticationButtonProps['buttonType'];
|
|
8
|
+
buttonStyle: IAppleAuthenticationButtonProps['buttonStyle'];
|
|
9
|
+
cornerRadius?: IAppleAuthenticationButtonProps['cornerRadius'];
|
|
10
|
+
protected readonly propNames: readonly ["onPress", "buttonType", "buttonStyle", "cornerRadius"];
|
|
11
|
+
protected renderView(props: object): IDescriptor | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
36
|
+
import { DescriptorOutlet, NativeViewBase } from '@symbiote-native/angular';
|
|
37
|
+
import { renderAppleAuthenticationButton } from '../../core/apple-authentication-button.js';
|
|
38
|
+
/** Angular twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
|
|
39
|
+
let AppleAuthenticationButton = (() => {
|
|
40
|
+
let _classDecorators = [Component({
|
|
41
|
+
selector: 'AppleAuthenticationButton',
|
|
42
|
+
standalone: true,
|
|
43
|
+
imports: [DescriptorOutlet],
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
template: `@if (descriptor; as node) {
|
|
46
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
47
|
+
}`,
|
|
48
|
+
})];
|
|
49
|
+
let _classDescriptor;
|
|
50
|
+
let _classExtraInitializers = [];
|
|
51
|
+
let _classThis;
|
|
52
|
+
let _classSuper = NativeViewBase;
|
|
53
|
+
let _onPress_decorators;
|
|
54
|
+
let _onPress_initializers = [];
|
|
55
|
+
let _onPress_extraInitializers = [];
|
|
56
|
+
let _buttonType_decorators;
|
|
57
|
+
let _buttonType_initializers = [];
|
|
58
|
+
let _buttonType_extraInitializers = [];
|
|
59
|
+
let _buttonStyle_decorators;
|
|
60
|
+
let _buttonStyle_initializers = [];
|
|
61
|
+
let _buttonStyle_extraInitializers = [];
|
|
62
|
+
let _cornerRadius_decorators;
|
|
63
|
+
let _cornerRadius_initializers = [];
|
|
64
|
+
let _cornerRadius_extraInitializers = [];
|
|
65
|
+
var AppleAuthenticationButton = class extends _classSuper {
|
|
66
|
+
static { _classThis = this; }
|
|
67
|
+
static {
|
|
68
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
69
|
+
_onPress_decorators = [Input({ required: true })];
|
|
70
|
+
_buttonType_decorators = [Input({ required: true })];
|
|
71
|
+
_buttonStyle_decorators = [Input({ required: true })];
|
|
72
|
+
_cornerRadius_decorators = [Input()];
|
|
73
|
+
__esDecorate(null, null, _onPress_decorators, { kind: "field", name: "onPress", static: false, private: false, access: { has: obj => "onPress" in obj, get: obj => obj.onPress, set: (obj, value) => { obj.onPress = value; } }, metadata: _metadata }, _onPress_initializers, _onPress_extraInitializers);
|
|
74
|
+
__esDecorate(null, null, _buttonType_decorators, { kind: "field", name: "buttonType", static: false, private: false, access: { has: obj => "buttonType" in obj, get: obj => obj.buttonType, set: (obj, value) => { obj.buttonType = value; } }, metadata: _metadata }, _buttonType_initializers, _buttonType_extraInitializers);
|
|
75
|
+
__esDecorate(null, null, _buttonStyle_decorators, { kind: "field", name: "buttonStyle", static: false, private: false, access: { has: obj => "buttonStyle" in obj, get: obj => obj.buttonStyle, set: (obj, value) => { obj.buttonStyle = value; } }, metadata: _metadata }, _buttonStyle_initializers, _buttonStyle_extraInitializers);
|
|
76
|
+
__esDecorate(null, null, _cornerRadius_decorators, { kind: "field", name: "cornerRadius", static: false, private: false, access: { has: obj => "cornerRadius" in obj, get: obj => obj.cornerRadius, set: (obj, value) => { obj.cornerRadius = value; } }, metadata: _metadata }, _cornerRadius_initializers, _cornerRadius_extraInitializers);
|
|
77
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
78
|
+
AppleAuthenticationButton = _classThis = _classDescriptor.value;
|
|
79
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
80
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
81
|
+
}
|
|
82
|
+
onPress = __runInitializers(this, _onPress_initializers, void 0);
|
|
83
|
+
buttonType = (__runInitializers(this, _onPress_extraInitializers), __runInitializers(this, _buttonType_initializers, void 0));
|
|
84
|
+
buttonStyle = (__runInitializers(this, _buttonType_extraInitializers), __runInitializers(this, _buttonStyle_initializers, void 0));
|
|
85
|
+
cornerRadius = (__runInitializers(this, _buttonStyle_extraInitializers), __runInitializers(this, _cornerRadius_initializers, void 0));
|
|
86
|
+
propNames = (__runInitializers(this, _cornerRadius_extraInitializers), [
|
|
87
|
+
'onPress',
|
|
88
|
+
'buttonType',
|
|
89
|
+
'buttonStyle',
|
|
90
|
+
'cornerRadius',
|
|
91
|
+
]);
|
|
92
|
+
renderView(props) {
|
|
93
|
+
return renderAppleAuthenticationButton(props);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return AppleAuthenticationButton = _classThis;
|
|
97
|
+
})();
|
|
98
|
+
export { AppleAuthenticationButton };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AppleAuthenticationButton } from './apple-authentication-button';
|
|
2
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationButtonProps, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @symbiote-native/apple-authentication/angular: кнопка и поток входа на общем ядре
|
|
2
|
+
export { AppleAuthenticationButton } from './apple-authentication-button/index.js';
|
|
3
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from '../core/index.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IAccessibilityProps, IAriaProps, IDescriptor, IResponderProps } from '@symbiote-native/components';
|
|
2
|
+
import type { IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote-native/engine';
|
|
3
|
+
import type { AppleAuthenticationButtonStyle, AppleAuthenticationButtonType } from './types';
|
|
4
|
+
export type IAppleAuthenticationButtonProps = IAccessibilityProps & IAriaProps & IResponderProps & {
|
|
5
|
+
/** Call `signInAsync` in here */
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
buttonType: AppleAuthenticationButtonType;
|
|
8
|
+
buttonStyle: AppleAuthenticationButtonStyle;
|
|
9
|
+
/** Works like `style.borderRadius` of a View */
|
|
10
|
+
cornerRadius?: number;
|
|
11
|
+
/** Needs a width and a height, or the button does not appear */
|
|
12
|
+
style?: IStyleProp<Omit<IViewStyle, 'backgroundColor' | 'borderRadius'>>;
|
|
13
|
+
testID?: string;
|
|
14
|
+
nativeID?: string;
|
|
15
|
+
onLayout?: (event: ISymbioteEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const appleAuthenticationButtonViewName: () => string;
|
|
18
|
+
export declare function ensureAppleAuthenticationButtonRegistered(): boolean;
|
|
19
|
+
/** `null` means the caller renders nothing, the system button exists only on iOS */
|
|
20
|
+
export declare function renderAppleAuthenticationButton(props: object): IDescriptor | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Ядро `AppleAuthenticationButton`: нативный view системной кнопки Sign in with Apple, только iOS
|
|
2
|
+
import { Platform, requireNativeViewManager } from 'expo-modules-core';
|
|
3
|
+
import { el } from '@symbiote-native/components';
|
|
4
|
+
import { defineExpoNativeView, isDevBuild } from '@symbiote-native/engine';
|
|
5
|
+
import { APPLE_AUTHENTICATION_MODULE_NAME } from './constants.js';
|
|
6
|
+
const PRESS_EVENT_PROP = 'onButtonPress';
|
|
7
|
+
// Регистрация идёт при рендере: побочный эффект барреля теряется в release
|
|
8
|
+
const buttonView = defineExpoNativeView(requireNativeViewManager, APPLE_AUTHENTICATION_MODULE_NAME);
|
|
9
|
+
export const appleAuthenticationButtonViewName = buttonView.name;
|
|
10
|
+
export function ensureAppleAuthenticationButtonRegistered() {
|
|
11
|
+
if (!Platform.select({ ios: true, default: false }))
|
|
12
|
+
return false;
|
|
13
|
+
return buttonView.ensureRegistered();
|
|
14
|
+
}
|
|
15
|
+
/** `null` means the caller renders nothing, the system button exists only on iOS */
|
|
16
|
+
export function renderAppleAuthenticationButton(props) {
|
|
17
|
+
if (!ensureAppleAuthenticationButtonRegistered()) {
|
|
18
|
+
if (isDevBuild()) {
|
|
19
|
+
console.warn("'AppleAuthenticationButton' is not available.");
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const { onPress, ...viewProps } = Object.fromEntries(Object.entries(props));
|
|
24
|
+
return el(appleAuthenticationButtonViewName(), {
|
|
25
|
+
...viewProps,
|
|
26
|
+
[PRESS_EVENT_PROP]: onPress,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EventSubscription } from 'expo-modules-core';
|
|
2
|
+
import type { AppleAuthenticationCredentialState, IAppleAuthenticationCredential, IAppleAuthenticationFullName, IAppleAuthenticationFullNameFormatStyle, IAppleAuthenticationRefreshOptions, IAppleAuthenticationSignInOptions, IAppleAuthenticationSignOutOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the device's operating system supports Apple authentication
|
|
5
|
+
* @returns `true` when the system supports it, `false` otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function isAvailableAsync(): Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* Starts the Apple authentication flow, which presents a modal over the app
|
|
10
|
+
* The credential carries the name and email only the first time a user signs in, store it
|
|
11
|
+
* @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
|
|
12
|
+
*/
|
|
13
|
+
export declare function signInAsync(options?: IAppleAuthenticationSignInOptions): Promise<IAppleAuthenticationCredential>;
|
|
14
|
+
/**
|
|
15
|
+
* Refreshes the credentials of the logged-in user, the sign in modal shows first
|
|
16
|
+
* @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
|
|
17
|
+
*/
|
|
18
|
+
export declare function refreshAsync(options: IAppleAuthenticationRefreshOptions): Promise<IAppleAuthenticationCredential>;
|
|
19
|
+
/**
|
|
20
|
+
* Ends the authenticated session, the sign in modal shows first
|
|
21
|
+
* Clearing the stored user data after `signInAsync` is the recommended way to sign out
|
|
22
|
+
* @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
|
|
23
|
+
*/
|
|
24
|
+
export declare function signOutAsync(options: IAppleAuthenticationSignOutOptions): Promise<IAppleAuthenticationCredential>;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the credential of a user is still valid or was revoked
|
|
27
|
+
* On the iOS simulator it always throws, test on a real device
|
|
28
|
+
* @param user The `user` field of an `IAppleAuthenticationCredential`
|
|
29
|
+
*/
|
|
30
|
+
export declare function getCredentialStateAsync(user: string): Promise<AppleAuthenticationCredentialState>;
|
|
31
|
+
/** A locale-aware string of a person's name built from its tokenized portions */
|
|
32
|
+
export declare function formatFullName(fullName: IAppleAuthenticationFullName, formatStyle?: IAppleAuthenticationFullNameFormatStyle): string;
|
|
33
|
+
/** Calls the listener when the user revokes the credential of the app in the system settings */
|
|
34
|
+
export declare function addRevokeListener(listener: () => void): EventSubscription;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { CodedError, UnavailabilityError } from 'expo-modules-core';
|
|
2
|
+
import { REVOKE_EVENT_NAME } from './constants.js';
|
|
3
|
+
import { expoAppleAuthentication } from './native-module.js';
|
|
4
|
+
import { AppleAuthenticationOperation } from './types.js';
|
|
5
|
+
const NATIVE_MODULE_NAME = 'expo-apple-authentication';
|
|
6
|
+
// Сообщение ссылается на имя вызванной функции, поэтому оно приходит параметром
|
|
7
|
+
async function requestCredential(functionName, request) {
|
|
8
|
+
if (!expoAppleAuthentication.requestAsync) {
|
|
9
|
+
throw new UnavailabilityError(NATIVE_MODULE_NAME, functionName);
|
|
10
|
+
}
|
|
11
|
+
return expoAppleAuthentication.requestAsync(request);
|
|
12
|
+
}
|
|
13
|
+
// Вход и обновление возвращают токены, без них учётные данные бесполезны
|
|
14
|
+
async function requestCompleteCredential(functionName, request) {
|
|
15
|
+
const credential = await requestCredential(functionName, request);
|
|
16
|
+
if (!credential.authorizationCode ||
|
|
17
|
+
!credential.identityToken ||
|
|
18
|
+
!credential.user) {
|
|
19
|
+
throw new CodedError('ERR_REQUEST_FAILED', `The credential returned by \`${functionName}\` is missing one or more required fields.`);
|
|
20
|
+
}
|
|
21
|
+
return credential;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Whether the device's operating system supports Apple authentication
|
|
25
|
+
* @returns `true` when the system supports it, `false` otherwise
|
|
26
|
+
*/
|
|
27
|
+
export async function isAvailableAsync() {
|
|
28
|
+
if (!expoAppleAuthentication.isAvailableAsync)
|
|
29
|
+
return false;
|
|
30
|
+
return expoAppleAuthentication.isAvailableAsync();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Starts the Apple authentication flow, which presents a modal over the app
|
|
34
|
+
* The credential carries the name and email only the first time a user signs in, store it
|
|
35
|
+
* @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
|
|
36
|
+
*/
|
|
37
|
+
export async function signInAsync(options) {
|
|
38
|
+
return requestCompleteCredential('signInAsync', {
|
|
39
|
+
...options,
|
|
40
|
+
requestedOperation: AppleAuthenticationOperation.LOGIN,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Refreshes the credentials of the logged-in user, the sign in modal shows first
|
|
45
|
+
* @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
|
|
46
|
+
*/
|
|
47
|
+
export async function refreshAsync(options) {
|
|
48
|
+
return requestCompleteCredential('refreshAsync', {
|
|
49
|
+
...options,
|
|
50
|
+
requestedOperation: AppleAuthenticationOperation.REFRESH,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Ends the authenticated session, the sign in modal shows first
|
|
55
|
+
* Clearing the stored user data after `signInAsync` is the recommended way to sign out
|
|
56
|
+
* @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
|
|
57
|
+
*/
|
|
58
|
+
export async function signOutAsync(options) {
|
|
59
|
+
return requestCredential('signOutAsync', {
|
|
60
|
+
...options,
|
|
61
|
+
requestedOperation: AppleAuthenticationOperation.LOGOUT,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Whether the credential of a user is still valid or was revoked
|
|
66
|
+
* On the iOS simulator it always throws, test on a real device
|
|
67
|
+
* @param user The `user` field of an `IAppleAuthenticationCredential`
|
|
68
|
+
*/
|
|
69
|
+
export async function getCredentialStateAsync(user) {
|
|
70
|
+
if (!expoAppleAuthentication.getCredentialStateAsync) {
|
|
71
|
+
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'getCredentialStateAsync');
|
|
72
|
+
}
|
|
73
|
+
return expoAppleAuthentication.getCredentialStateAsync(user);
|
|
74
|
+
}
|
|
75
|
+
/** A locale-aware string of a person's name built from its tokenized portions */
|
|
76
|
+
export function formatFullName(fullName, formatStyle) {
|
|
77
|
+
if (!expoAppleAuthentication.formatFullName) {
|
|
78
|
+
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'formatFullName');
|
|
79
|
+
}
|
|
80
|
+
return expoAppleAuthentication.formatFullName(fullName, formatStyle);
|
|
81
|
+
}
|
|
82
|
+
/** Calls the listener when the user revokes the credential of the app in the system settings */
|
|
83
|
+
export function addRevokeListener(listener) {
|
|
84
|
+
return expoAppleAuthentication.addListener(REVOKE_EVENT_NAME, listener);
|
|
85
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { addRevokeListener, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from './apple-authentication';
|
|
2
|
+
export { appleAuthenticationButtonViewName, ensureAppleAuthenticationButtonRegistered, renderAppleAuthenticationButton, type IAppleAuthenticationButtonProps, } from './apple-authentication-button';
|
|
3
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME } from './constants';
|
|
4
|
+
export { AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from './types';
|
|
5
|
+
export type { EventSubscription } from 'expo-modules-core';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { addRevokeListener, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from './apple-authentication.js';
|
|
2
|
+
export { appleAuthenticationButtonViewName, ensureAppleAuthenticationButtonRegistered, renderAppleAuthenticationButton, } from './apple-authentication-button.js';
|
|
3
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME } from './constants.js';
|
|
4
|
+
export { AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, } from './types.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EventSubscription } from 'expo-modules-core';
|
|
2
|
+
import type { IAppleAuthenticationCredential, IAppleAuthenticationFullName, IAppleAuthenticationFullNameFormatStyle, IAppleAuthenticationRequest, AppleAuthenticationCredentialState } from './types';
|
|
3
|
+
export type INativeAppleAuthenticationModule = {
|
|
4
|
+
addListener(eventName: string, listener: () => void): EventSubscription;
|
|
5
|
+
isAvailableAsync?(): Promise<boolean>;
|
|
6
|
+
requestAsync?(options: IAppleAuthenticationRequest): Promise<IAppleAuthenticationCredential>;
|
|
7
|
+
getCredentialStateAsync?(user: string): Promise<AppleAuthenticationCredentialState>;
|
|
8
|
+
formatFullName?(fullName: IAppleAuthenticationFullName, formatStyle?: IAppleAuthenticationFullNameFormatStyle): string;
|
|
9
|
+
};
|
|
10
|
+
export declare const expoAppleAuthentication: INativeAppleAuthenticationModule;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { requireOptionalNativeModule } from 'expo-modules-core';
|
|
2
|
+
import { APPLE_AUTHENTICATION_MODULE_NAME } from './constants.js';
|
|
3
|
+
// Вместо `null` на неподдерживаемой платформе, чтобы `isAvailableAsync` отвечал `false`
|
|
4
|
+
const unsupportedModule = {
|
|
5
|
+
isAvailableAsync: () => Promise.resolve(false),
|
|
6
|
+
addListener: () => ({ remove: () => undefined }),
|
|
7
|
+
};
|
|
8
|
+
export const expoAppleAuthentication = requireOptionalNativeModule(APPLE_AUTHENTICATION_MODULE_NAME) ?? unsupportedModule;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** Scopes for `signInAsync`, the user may deny any of them, so handle `null` fields */
|
|
2
|
+
export declare enum AppleAuthenticationScope {
|
|
3
|
+
FULL_NAME = 0,
|
|
4
|
+
EMAIL = 1
|
|
5
|
+
}
|
|
6
|
+
export declare enum AppleAuthenticationOperation {
|
|
7
|
+
/** An operation that depends on the particular kind of credential provider */
|
|
8
|
+
IMPLICIT = 0,
|
|
9
|
+
LOGIN = 1,
|
|
10
|
+
REFRESH = 2,
|
|
11
|
+
LOGOUT = 3
|
|
12
|
+
}
|
|
13
|
+
/** The state of a credential checked with `getCredentialStateAsync` */
|
|
14
|
+
export declare enum AppleAuthenticationCredentialState {
|
|
15
|
+
REVOKED = 0,
|
|
16
|
+
AUTHORIZED = 1,
|
|
17
|
+
NOT_FOUND = 2,
|
|
18
|
+
TRANSFERRED = 3
|
|
19
|
+
}
|
|
20
|
+
/** The system's guess of how likely the user is a real person */
|
|
21
|
+
export declare enum AppleAuthenticationUserDetectionStatus {
|
|
22
|
+
/** The system does not support this determination and there is no data */
|
|
23
|
+
UNSUPPORTED = 0,
|
|
24
|
+
/** The system has not determined whether the user might be a real person */
|
|
25
|
+
UNKNOWN = 1,
|
|
26
|
+
/** The user appears to be a real person */
|
|
27
|
+
LIKELY_REAL = 2
|
|
28
|
+
}
|
|
29
|
+
/** Which pre-defined text the button shows */
|
|
30
|
+
export declare enum AppleAuthenticationButtonType {
|
|
31
|
+
/** "Sign in with Apple" */
|
|
32
|
+
SIGN_IN = 0,
|
|
33
|
+
/** "Continue with Apple" */
|
|
34
|
+
CONTINUE = 1,
|
|
35
|
+
/**
|
|
36
|
+
* "Sign up with Apple"
|
|
37
|
+
* @platform ios 13.2+
|
|
38
|
+
*/
|
|
39
|
+
SIGN_UP = 2
|
|
40
|
+
}
|
|
41
|
+
/** Which pre-defined color scheme the button uses */
|
|
42
|
+
export declare enum AppleAuthenticationButtonStyle {
|
|
43
|
+
/** White button with black text */
|
|
44
|
+
WHITE = 0,
|
|
45
|
+
/** White button with a black outline and black text */
|
|
46
|
+
WHITE_OUTLINE = 1,
|
|
47
|
+
/** Black button with white text */
|
|
48
|
+
BLACK = 2
|
|
49
|
+
}
|
|
50
|
+
/** The style a name is formatted in, see `formatFullName` */
|
|
51
|
+
export type IAppleAuthenticationFullNameFormatStyle = 'default' | 'short' | 'medium' | 'long' | 'abbreviated';
|
|
52
|
+
/** The tokenized portions of the user's name, only what the user allowed is not `null` */
|
|
53
|
+
export type IAppleAuthenticationFullName = {
|
|
54
|
+
namePrefix: string | null;
|
|
55
|
+
givenName: string | null;
|
|
56
|
+
middleName: string | null;
|
|
57
|
+
familyName: string | null;
|
|
58
|
+
nameSuffix: string | null;
|
|
59
|
+
nickname: string | null;
|
|
60
|
+
};
|
|
61
|
+
type IRequestOptions = {
|
|
62
|
+
/**
|
|
63
|
+
* Scopes the app asks for, they come only the first time a user signs in
|
|
64
|
+
* @default []
|
|
65
|
+
*/
|
|
66
|
+
requestedScopes?: AppleAuthenticationScope[];
|
|
67
|
+
/** An arbitrary string returned unmodified in the credential, it guards against replay attacks */
|
|
68
|
+
state?: string;
|
|
69
|
+
};
|
|
70
|
+
/** Options for `signInAsync`, none is required */
|
|
71
|
+
export type IAppleAuthenticationSignInOptions = IRequestOptions & {
|
|
72
|
+
/** An arbitrary string that prevents replay attacks */
|
|
73
|
+
nonce?: string;
|
|
74
|
+
};
|
|
75
|
+
/** Options for `refreshAsync`, `user` is the id of the user whose credentials refresh */
|
|
76
|
+
export type IAppleAuthenticationRefreshOptions = IRequestOptions & {
|
|
77
|
+
user: string;
|
|
78
|
+
};
|
|
79
|
+
/** Options for `signOutAsync`, `user` is the id of the user to sign out */
|
|
80
|
+
export type IAppleAuthenticationSignOutOptions = {
|
|
81
|
+
user: string;
|
|
82
|
+
state?: string;
|
|
83
|
+
};
|
|
84
|
+
/** What a successful `signInAsync`, `refreshAsync` or `signOutAsync` resolves with */
|
|
85
|
+
export type IAppleAuthenticationCredential = {
|
|
86
|
+
/** Stable across apps of one development team, use it to check the user later */
|
|
87
|
+
user: string;
|
|
88
|
+
/** The `state` the request carried, `null` when none was given */
|
|
89
|
+
state: string | null;
|
|
90
|
+
/** `null` without the `FULL_NAME` scope, on a denial, or after the first sign-in */
|
|
91
|
+
fullName: IAppleAuthenticationFullName | null;
|
|
92
|
+
/** Obscured with an Apple domain when the user withholds the address */
|
|
93
|
+
email: string | null;
|
|
94
|
+
realUserStatus: AppleAuthenticationUserDetectionStatus;
|
|
95
|
+
/** A JSON Web Token with information about the user */
|
|
96
|
+
identityToken: string | null;
|
|
97
|
+
/** A short-lived session token for the app's server, it changes every session */
|
|
98
|
+
authorizationCode: string | null;
|
|
99
|
+
};
|
|
100
|
+
/** What the native module accepts: the options of a call plus the operation it performs */
|
|
101
|
+
export type IAppleAuthenticationRequest = (IAppleAuthenticationSignInOptions | IAppleAuthenticationRefreshOptions | IAppleAuthenticationSignOutOptions) & {
|
|
102
|
+
requestedOperation: AppleAuthenticationOperation;
|
|
103
|
+
};
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Типы и enum-ы `expo-apple-authentication`, порт `AppleAuthentication.types.ts`
|
|
2
|
+
/** Scopes for `signInAsync`, the user may deny any of them, so handle `null` fields */
|
|
3
|
+
export var AppleAuthenticationScope;
|
|
4
|
+
(function (AppleAuthenticationScope) {
|
|
5
|
+
AppleAuthenticationScope[AppleAuthenticationScope["FULL_NAME"] = 0] = "FULL_NAME";
|
|
6
|
+
AppleAuthenticationScope[AppleAuthenticationScope["EMAIL"] = 1] = "EMAIL";
|
|
7
|
+
})(AppleAuthenticationScope || (AppleAuthenticationScope = {}));
|
|
8
|
+
export var AppleAuthenticationOperation;
|
|
9
|
+
(function (AppleAuthenticationOperation) {
|
|
10
|
+
/** An operation that depends on the particular kind of credential provider */
|
|
11
|
+
AppleAuthenticationOperation[AppleAuthenticationOperation["IMPLICIT"] = 0] = "IMPLICIT";
|
|
12
|
+
AppleAuthenticationOperation[AppleAuthenticationOperation["LOGIN"] = 1] = "LOGIN";
|
|
13
|
+
AppleAuthenticationOperation[AppleAuthenticationOperation["REFRESH"] = 2] = "REFRESH";
|
|
14
|
+
AppleAuthenticationOperation[AppleAuthenticationOperation["LOGOUT"] = 3] = "LOGOUT";
|
|
15
|
+
})(AppleAuthenticationOperation || (AppleAuthenticationOperation = {}));
|
|
16
|
+
/** The state of a credential checked with `getCredentialStateAsync` */
|
|
17
|
+
export var AppleAuthenticationCredentialState;
|
|
18
|
+
(function (AppleAuthenticationCredentialState) {
|
|
19
|
+
AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["REVOKED"] = 0] = "REVOKED";
|
|
20
|
+
AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["AUTHORIZED"] = 1] = "AUTHORIZED";
|
|
21
|
+
AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["NOT_FOUND"] = 2] = "NOT_FOUND";
|
|
22
|
+
AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["TRANSFERRED"] = 3] = "TRANSFERRED";
|
|
23
|
+
})(AppleAuthenticationCredentialState || (AppleAuthenticationCredentialState = {}));
|
|
24
|
+
/** The system's guess of how likely the user is a real person */
|
|
25
|
+
export var AppleAuthenticationUserDetectionStatus;
|
|
26
|
+
(function (AppleAuthenticationUserDetectionStatus) {
|
|
27
|
+
/** The system does not support this determination and there is no data */
|
|
28
|
+
AppleAuthenticationUserDetectionStatus[AppleAuthenticationUserDetectionStatus["UNSUPPORTED"] = 0] = "UNSUPPORTED";
|
|
29
|
+
/** The system has not determined whether the user might be a real person */
|
|
30
|
+
AppleAuthenticationUserDetectionStatus[AppleAuthenticationUserDetectionStatus["UNKNOWN"] = 1] = "UNKNOWN";
|
|
31
|
+
/** The user appears to be a real person */
|
|
32
|
+
AppleAuthenticationUserDetectionStatus[AppleAuthenticationUserDetectionStatus["LIKELY_REAL"] = 2] = "LIKELY_REAL";
|
|
33
|
+
})(AppleAuthenticationUserDetectionStatus || (AppleAuthenticationUserDetectionStatus = {}));
|
|
34
|
+
/** Which pre-defined text the button shows */
|
|
35
|
+
export var AppleAuthenticationButtonType;
|
|
36
|
+
(function (AppleAuthenticationButtonType) {
|
|
37
|
+
/** "Sign in with Apple" */
|
|
38
|
+
AppleAuthenticationButtonType[AppleAuthenticationButtonType["SIGN_IN"] = 0] = "SIGN_IN";
|
|
39
|
+
/** "Continue with Apple" */
|
|
40
|
+
AppleAuthenticationButtonType[AppleAuthenticationButtonType["CONTINUE"] = 1] = "CONTINUE";
|
|
41
|
+
/**
|
|
42
|
+
* "Sign up with Apple"
|
|
43
|
+
* @platform ios 13.2+
|
|
44
|
+
*/
|
|
45
|
+
AppleAuthenticationButtonType[AppleAuthenticationButtonType["SIGN_UP"] = 2] = "SIGN_UP";
|
|
46
|
+
})(AppleAuthenticationButtonType || (AppleAuthenticationButtonType = {}));
|
|
47
|
+
/** Which pre-defined color scheme the button uses */
|
|
48
|
+
export var AppleAuthenticationButtonStyle;
|
|
49
|
+
(function (AppleAuthenticationButtonStyle) {
|
|
50
|
+
/** White button with black text */
|
|
51
|
+
AppleAuthenticationButtonStyle[AppleAuthenticationButtonStyle["WHITE"] = 0] = "WHITE";
|
|
52
|
+
/** White button with a black outline and black text */
|
|
53
|
+
AppleAuthenticationButtonStyle[AppleAuthenticationButtonStyle["WHITE_OUTLINE"] = 1] = "WHITE_OUTLINE";
|
|
54
|
+
/** Black button with white text */
|
|
55
|
+
AppleAuthenticationButtonStyle[AppleAuthenticationButtonStyle["BLACK"] = 2] = "BLACK";
|
|
56
|
+
})(AppleAuthenticationButtonStyle || (AppleAuthenticationButtonStyle = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { IAppleAuthenticationButtonProps } from '../core/apple-authentication-button';
|
|
3
|
+
/** React twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
|
|
4
|
+
export declare function AppleAuthenticationButton(props: IAppleAuthenticationButtonProps & {
|
|
5
|
+
className?: string;
|
|
6
|
+
}): ReactElement | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { descriptorToReact } from '@symbiote-native/react';
|
|
2
|
+
import { renderAppleAuthenticationButton } from '../core/apple-authentication-button.js';
|
|
3
|
+
/** React twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
|
|
4
|
+
export function AppleAuthenticationButton(props) {
|
|
5
|
+
const descriptor = renderAppleAuthenticationButton(props);
|
|
6
|
+
return descriptor ? descriptorToReact(descriptor) : null;
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AppleAuthenticationButton } from './apple-authentication-button';
|
|
2
|
+
export type { IAppleAuthenticationButtonProps } from '../core';
|
|
3
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @symbiote-native/apple-authentication/react: кнопка и поток входа на общем ядре
|
|
2
|
+
export { AppleAuthenticationButton } from './apple-authentication-button.js';
|
|
3
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from '../core/index.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IAppleAuthenticationButtonProps } from '../core/apple-authentication-button';
|
|
2
|
+
/** Solid twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
|
|
3
|
+
export declare const AppleAuthenticationButton: (props: IAppleAuthenticationButtonProps) => import("@symbiote-native/engine").ISymbioteNode | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defineOptionalDescriptorComponent } from '@symbiote-native/solid';
|
|
2
|
+
import { renderAppleAuthenticationButton } from '../core/apple-authentication-button.js';
|
|
3
|
+
/** Solid twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
|
|
4
|
+
export const AppleAuthenticationButton = defineOptionalDescriptorComponent(renderAppleAuthenticationButton);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AppleAuthenticationButton } from './apple-authentication-button';
|
|
2
|
+
export type { IAppleAuthenticationButtonProps } from '../core';
|
|
3
|
+
export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
|