@dubsdotapp/expo 0.1.1 → 0.1.2

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/dist/index.d.mts CHANGED
@@ -512,6 +512,33 @@ interface UseAuthResult {
512
512
  }
513
513
  declare function useAuth(): UseAuthResult;
514
514
 
515
+ interface RegistrationScreenProps {
516
+ /** Called when the user submits registration */
517
+ onRegister: (username: string, referralCode?: string) => void;
518
+ /** Whether a registration request is in flight */
519
+ registering: boolean;
520
+ /** Error from the last registration attempt, or null */
521
+ error: Error | null;
522
+ /** DubsClient instance for checkUsername() availability checks */
523
+ client: DubsClient;
524
+ }
525
+ interface AuthGateProps {
526
+ children: React.ReactNode;
527
+ /** Persist or clear the JWT token (called with null on logout) */
528
+ onSaveToken: (token: string | null) => void | Promise<void>;
529
+ /** Load a previously persisted JWT token */
530
+ onLoadToken: () => string | null | Promise<string | null>;
531
+ /** Custom loading screen (receives current auth status) */
532
+ renderLoading?: (status: AuthStatus) => React.ReactNode;
533
+ /** Custom error screen (receives the error and a retry callback) */
534
+ renderError?: (error: Error, retry: () => void) => React.ReactNode;
535
+ /** Custom registration screen */
536
+ renderRegistration?: (props: RegistrationScreenProps) => React.ReactNode;
537
+ /** App name shown in default screens. Defaults to "Dubs" */
538
+ appName?: string;
539
+ }
540
+ declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, }: AuthGateProps): react_jsx_runtime.JSX.Element;
541
+
515
542
  interface ConnectWalletScreenProps {
516
543
  /** Called when the user taps Connect Wallet */
517
544
  onConnect: () => void | Promise<void>;
@@ -574,4 +601,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
574
601
  */
575
602
  declare function pollTransactionConfirmation(signature: string, connection: Connection, commitment?: TransactionConfirmationStatus, timeout?: number, interval?: number): Promise<void>;
576
603
 
577
- export { type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
604
+ export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
package/dist/index.d.ts CHANGED
@@ -512,6 +512,33 @@ interface UseAuthResult {
512
512
  }
513
513
  declare function useAuth(): UseAuthResult;
514
514
 
515
+ interface RegistrationScreenProps {
516
+ /** Called when the user submits registration */
517
+ onRegister: (username: string, referralCode?: string) => void;
518
+ /** Whether a registration request is in flight */
519
+ registering: boolean;
520
+ /** Error from the last registration attempt, or null */
521
+ error: Error | null;
522
+ /** DubsClient instance for checkUsername() availability checks */
523
+ client: DubsClient;
524
+ }
525
+ interface AuthGateProps {
526
+ children: React.ReactNode;
527
+ /** Persist or clear the JWT token (called with null on logout) */
528
+ onSaveToken: (token: string | null) => void | Promise<void>;
529
+ /** Load a previously persisted JWT token */
530
+ onLoadToken: () => string | null | Promise<string | null>;
531
+ /** Custom loading screen (receives current auth status) */
532
+ renderLoading?: (status: AuthStatus) => React.ReactNode;
533
+ /** Custom error screen (receives the error and a retry callback) */
534
+ renderError?: (error: Error, retry: () => void) => React.ReactNode;
535
+ /** Custom registration screen */
536
+ renderRegistration?: (props: RegistrationScreenProps) => React.ReactNode;
537
+ /** App name shown in default screens. Defaults to "Dubs" */
538
+ appName?: string;
539
+ }
540
+ declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, }: AuthGateProps): react_jsx_runtime.JSX.Element;
541
+
515
542
  interface ConnectWalletScreenProps {
516
543
  /** Called when the user taps Connect Wallet */
517
544
  onConnect: () => void | Promise<void>;
@@ -574,4 +601,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
574
601
  */
575
602
  declare function pollTransactionConfirmation(signature: string, connection: Connection, commitment?: TransactionConfirmationStatus, timeout?: number, interval?: number): Promise<void>;
576
603
 
577
- export { type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
604
+ export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, type NonceResult, type Opponent, type Pagination, type ParsedError, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, parseSolanaError, pollTransactionConfirmation, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };