RefreshOutcome — @gj-kit/expo-auth
@gj-kit/expo-auth에서 공개하는 type입니다. package version 0.1.1의 release declaration을 그대로 표시합니다.
검증된 import 예제
섹션 제목: “검증된 import 예제”import { RefreshOutcome } from '@gj-kit/expo-auth';시그니처, 매개변수, 반환 타입
섹션 제목: “시그니처, 매개변수, 반환 타입”/** * The five endings of `refresh()` (design §3.4). The library cleans storage where required but * never navigates or resets app state — that is the caller's decision. * * - `'refreshed'`: this instance performed the rotation. Persisted and rescheduled. * - `'adopted'`: storage now holds a valid pair **different** from the entry snapshot and that * pair was adopted (H2·H2b). Rescheduled. ⚠ Adoption does NOT guarantee the same subject — * another tab's signOut→sign-in-as-someone-else also appears as `'adopted'`. Hosts where * account switching is possible must re-confirm the subject (e.g. re-fetch /me) after * adopting (§7-13). * - `'signed-out'`: storage holds no refresh token (already signed out). * - `'invalid'`: a definitive server rejection. `tokensCleared` follows the H3 discipline — * `true` only when the attempted token was still the stored one. The caller decides whether * to navigate to the sign-in screen. * - `'transient'`: undecidable. Tokens are preserved — never a sign-out (H1). `cause` carries * the value thrown by the refresh callback (§3.3 fail-safe diagnostics channel), or is * `undefined` when the callback reported `'transient'` normally. Retry policy belongs to the * caller (React Query and friends). */type RefreshOutcome = { readonly status: 'refreshed'; readonly tokens: TokenPair;} | { readonly status: 'adopted'; readonly tokens: TokenPair;} | { readonly status: 'signed-out';} | { readonly status: 'invalid'; readonly tokensCleared: boolean;} | { readonly status: 'transient'; readonly cause?: unknown;};이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.
Release context
섹션 제목: “Release context”- 패키지:
@gj-kit/expo-auth - 버전:
0.1.1 - 공개 entry:
. - 소스: GitHub
구현 주석
섹션 제목: “구현 주석”The five endings of refresh() (design §3.4). The library cleans storage where required but
never navigates or resets app state — that is the caller’s decision.
'refreshed': this instance performed the rotation. Persisted and rescheduled.'adopted': storage now holds a valid pair different from the entry snapshot and that pair was adopted (H2·H2b). Rescheduled. ⚠ Adoption does NOT guarantee the same subject — another tab’s signOut→sign-in-as-someone-else also appears as'adopted'. Hosts where account switching is possible must re-confirm the subject (e.g. re-fetch /me) after adopting (§7-13).'signed-out': storage holds no refresh token (already signed out).'invalid': a definitive server rejection.tokensClearedfollows the H3 discipline —trueonly when the attempted token was still the stored one. The caller decides whether to navigate to the sign-in screen.'transient': undecidable. Tokens are preserved — never a sign-out (H1).causecarries the value thrown by the refresh callback (§3.3 fail-safe diagnostics channel), or isundefinedwhen the callback reported'transient'normally. Retry policy belongs to the caller (React Query and friends).