Skip to content

matchRefreshOutcome — @gj-kit/expo-auth

A public function from @gj-kit/expo-auth. The signature below is taken directly from the 0.1.1 release declaration.

import { matchRefreshOutcome } from '@gj-kit/expo-auth';
/**
* Exhaustive matcher over the five endings. TypeScript does not force exhaustiveness on raw
* `switch`/`if` (§4.1-③ — `assertNever` is only an opt-in pattern), so the library ships a
* consumption form where a missing handler key is a **compile error**.
*/
declare function matchRefreshOutcome<T>(outcome: RefreshOutcome, handlers: {
readonly refreshed: (outcome: Extract<RefreshOutcome, {
status: 'refreshed';
}>) => T;
readonly adopted: (outcome: Extract<RefreshOutcome, {
status: 'adopted';
}>) => T;
readonly 'signed-out': (outcome: Extract<RefreshOutcome, {
status: 'signed-out';
}>) => T;
readonly invalid: (outcome: Extract<RefreshOutcome, {
status: 'invalid';
}>) => T;
readonly transient: (outcome: Extract<RefreshOutcome, {
status: 'transient';
}>) => T;
}): T;

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/expo-auth
  • Version: 0.1.1
  • Public entry: .
  • Source: GitHub