Skip to content

Commit 659a260

Browse files
refactor: Enhance documentation and structure in TypeScript interfaces and configuration
1 parent 68da0e4 commit 659a260

5 files changed

Lines changed: 97 additions & 55 deletions

File tree

src/core/interfaces/IWebAuthProvider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ export interface IWebAuthProvider {
4848
* Cancels an ongoing web authentication transaction.
4949
*
5050
* @remarks
51-
* This is primarily used on iOS to handle scenarios where the user manually
51+
* **Platform specific:** This is primarily used on iOS to handle scenarios where the user manually
5252
* dismisses the login modal. On other platforms, it may be a no-op.
53-
* Cancels an ongoing web authentication transaction.
54-
* @platform ios
5553
*
5654
* @returns A promise that resolves when the operation is complete.
5755
*/

src/hooks/Auth0Context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export interface Auth0ContextInterface extends AuthState {
4343
/**
4444
* Clears the user's session and logs them out.
4545
* @param parameters The parameters to send to the `/v2/logout` endpoint.
46-
* @param options Platform-specific options to customize the logout experience.
4746
* @returns A promise that resolves when the session has been cleared.
4847
* @throws {AuthError} If the logout fails.
4948
*/

src/types/parameters.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export interface WebAuthorizeParameters {
6464
* Specify a custom redirect URL to be used. Normally, you wouldn't need to call this method manually as the default value is autogenerated for you.
6565
*
6666
* If you are using this, ensure a proper redirect URL is constructed in the following format
67-
* Android: {YOUR_APP_PACKAGE_NAME}.auth0://{AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
68-
* iOS: {PRODUCT_BUNDLE_IDENTIFIER}.auth0://{AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
67+
* - **Android:** `{YOUR_APP_PACKAGE_NAME}.auth0://{AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback`
68+
* - **iOS:** `{PRODUCT_BUNDLE_IDENTIFIER}.auth0://{AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback`
6969
*
7070
* If you have `useLegacyCallbackUrl` set to true then the redirect URL should in the format
71-
* Android: {YOUR_APP_PACKAGE_NAME}://{AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
72-
* iOS: {PRODUCT_BUNDLE_IDENTIFIER}://{AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
71+
* - **Android:** `{YOUR_APP_PACKAGE_NAME}://{AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback`
72+
* - **iOS:** `{PRODUCT_BUNDLE_IDENTIFIER}://{AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback`
7373
*/
7474
redirectUrl?: string;
7575
/**
@@ -230,15 +230,6 @@ export interface CreateUserParameters extends RequestOptions {
230230
metadata?: object;
231231
}
232232

233-
/**
234-
* Parameters for fetching a user's profile information.
235-
* @see https://auth0.com/docs/api/authentication#user-profile
236-
*/
237-
export interface UserInfoParameters {
238-
/** The access token of the user. */
239-
token: string;
240-
}
241-
242233
/**
243234
* Parameters for patching a user's metadata via the Management API.
244235
* Requires an access token with `update:current_user_metadata` scope.

src/types/platform-specific.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import type { Auth0Options } from './common';
33
// ========= Native Enums =========
44

55
/**
6-
* @platform ios
6+
* @remarks
7+
* **Platform specific:** iOS only.
78
* Presentation styles for the web-based login screen on iOS.
89
* @see https://developer.apple.com/documentation/uikit/uimodalpresentationstyle
910
*/
@@ -21,7 +22,8 @@ export enum SafariViewControllerPresentationStyle {
2122
}
2223

2324
/**
24-
* @platform android
25+
* @remarks
26+
* **Platform specific:** Android only.
2527
* The level of local authentication required to access credentials on Android.
2628
*/
2729
export enum LocalAuthenticationLevel {
@@ -31,7 +33,8 @@ export enum LocalAuthenticationLevel {
3133
}
3234

3335
/**
34-
* @platform ios
36+
* @remarks
37+
* **Platform specific:** iOS only.
3538
* The evaluation policy to use when accessing credentials on iOS.
3639
*/
3740
export enum LocalAuthenticationStrategy {
@@ -42,7 +45,8 @@ export enum LocalAuthenticationStrategy {
4245
// ========= Native-Specific Options =========
4346

4447
/**
45-
* @platform native
48+
* @remarks
49+
* **Platform specific:** Native only (iOS/Android).
4650
* Options for configuring local authentication (e.g., biometrics or device PIN).
4751
*/
4852
export interface LocalAuthenticationOptions {
@@ -56,15 +60,17 @@ export interface LocalAuthenticationOptions {
5660

5761
/**
5862
* Extends the core Auth0Options with native-specific configuration.
59-
* @platform native
63+
* @remarks
64+
* **Platform specific:** Native only (iOS/Android).
6065
*/
6166
export interface NativeAuth0Options extends Auth0Options {
6267
localAuthenticationOptions?: LocalAuthenticationOptions;
6368
}
6469

6570
/**
6671
* Options specific to the `authorize` method on Native platforms.
67-
* @platform native
72+
* @remarks
73+
* **Platform specific:** Native only (iOS/Android).
6874
*/
6975
export interface NativeAuthorizeOptions {
7076
/**
@@ -111,7 +117,8 @@ export interface NativeAuthorizeOptions {
111117

112118
/**
113119
* Options specific to the `clearSession` method on Native platforms.
114-
* @platform native
120+
* @remarks
121+
* **Platform specific:** Native only (iOS/Android).
115122
*/
116123
export interface NativeClearSessionOptions {
117124
/**
@@ -131,7 +138,8 @@ export interface NativeClearSessionOptions {
131138
/**
132139
* Extends the core Auth0Options with web-specific configuration
133140
* that is passed down to `@auth0/auth0-spa-js`.
134-
* @platform web
141+
* @remarks
142+
* **Platform specific:** Web only.
135143
* @see https://auth0.github.io/auth0-spa-js/interfaces/Auth0ClientOptions.html
136144
*/
137145
export interface WebAuth0Options extends Auth0Options {
@@ -148,13 +156,15 @@ export interface WebAuth0Options extends Auth0Options {
148156
/**
149157
* Options specific to the `authorize` method on the Web platform.
150158
* (Currently a placeholder, can be extended later).
151-
* @platform web
159+
* @remarks
160+
* **Platform specific:** Web only.
152161
*/
153162
export interface WebAuthorizeOptions {}
154163

155164
/**
156165
* Options specific to the `clearSession` method on the Web platform.
157166
* (Currently a placeholder, can be extended later).
158-
* @platform web
167+
* @remarks
168+
* **Platform specific:** Web only.
159169
*/
160170
export interface WebClearSessionOptions {}

typedoc.json

Lines changed: 72 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,81 @@
11
{
22
"entryPoints": ["src/index.ts"],
33
"out": "out",
4-
"jsDocCompatibility": false,
4+
"name": "React Native Auth0",
5+
"readme": "README.md",
6+
"theme": "default",
7+
"includeVersion": true,
8+
"excludePrivate": true,
9+
"excludeProtected": true,
10+
"excludeExternals": true,
11+
"sort": ["source-order"],
12+
"kindSortOrder": [
13+
"Project",
14+
"Module",
15+
"Namespace",
16+
"Enum",
17+
"Class",
18+
"Interface",
19+
"TypeAlias",
20+
"Constructor",
21+
"Property",
22+
"Method",
23+
"Function",
24+
"Accessor",
25+
"Variable"
26+
],
527
"plugin": ["typedoc-plugin-missing-exports", "typedoc-plugin-replace-text"],
628
"replaceText": {
729
"replacements": [
8-
{
9-
"pattern": "```objective-c",
10-
"replace": "```text"
11-
},
12-
{
13-
"pattern": "```objc",
14-
"replace": "```text"
15-
},
16-
{
17-
"pattern": "```groovy",
18-
"replace": "```text"
19-
},
20-
{
21-
"pattern": "```xml",
22-
"replace": "```text"
23-
},
24-
{
25-
"pattern": "```swift",
26-
"replace": "```text"
27-
},
28-
{
29-
"pattern": "```ruby",
30-
"replace": "```text"
31-
}
30+
{ "pattern": "```objective-c", "replace": "```text" },
31+
{ "pattern": "```objc", "replace": "```text" },
32+
{ "pattern": "```groovy", "replace": "```text" },
33+
{ "pattern": "```xml", "replace": "```text" },
34+
{ "pattern": "```swift", "replace": "```text" },
35+
{ "pattern": "```ruby", "replace": "```text" },
36+
{ "pattern": "```javascript", "replace": "```text" }
3237
]
3338
},
34-
"exclude": ["./src/internal-types.ts", "./src/webauth/agent.ts"],
35-
"excludeExternals": true,
36-
"internalModule": "Types"
39+
"githubPages": false,
40+
"hideGenerator": true,
41+
"searchInComments": true,
42+
"validation": {
43+
"notExported": true,
44+
"invalidLink": true,
45+
"notDocumented": false
46+
},
47+
"treatWarningsAsErrors": false,
48+
"blockTags": [
49+
"@example",
50+
"@deprecated",
51+
"@throws",
52+
"@since",
53+
"@see",
54+
"@remarks",
55+
"@param",
56+
"@returns",
57+
"@default"
58+
],
59+
"modifierTags": [
60+
"@public",
61+
"@private",
62+
"@protected",
63+
"@internal",
64+
"@override",
65+
"@readonly"
66+
],
67+
"categorizeByGroup": true,
68+
"groupOrder": [
69+
"Core Interfaces",
70+
"Platform-Specific Types",
71+
"Factory Functions",
72+
"Utility Functions",
73+
"React Hooks",
74+
"*"
75+
],
76+
"navigationLinks": {
77+
"GitHub": "https://github.com/auth0/react-native-auth0",
78+
"NPM": "https://npmjs.com/package/react-native-auth0",
79+
"Auth0 Docs": "https://auth0.com/docs"
80+
}
3781
}

0 commit comments

Comments
 (0)