61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import type { SessionState } from "../auth-session-port.js";
|
|
import type { StoragePort } from "../storage-port.js";
|
|
|
|
export type { SessionState } from "../auth-session-port.js";
|
|
|
|
export type ColorSchemePreference = "system" | "light" | "dark";
|
|
|
|
export type RenderFailureReport = Readonly<{
|
|
routeId: string;
|
|
buildId: string;
|
|
boundaryName: "route" | "feature";
|
|
}>;
|
|
|
|
export type RouteChangedReport = Readonly<{
|
|
routeId: string;
|
|
buildId: string;
|
|
}>;
|
|
|
|
export type ReleaseSummary = Readonly<{
|
|
buildId: string;
|
|
releaseId: string;
|
|
configSchemaVersion: string;
|
|
apiContractVersion: string;
|
|
}>;
|
|
|
|
export type ApplicationApi = Readonly<{
|
|
session: Readonly<{
|
|
getSnapshot(): SessionState;
|
|
subscribe(listener: () => void): () => void;
|
|
beginSignIn(returnTo?: string): Promise<void>;
|
|
signOut(): Promise<void>;
|
|
recover(): Promise<"restored" | "no-session">;
|
|
}>;
|
|
preferences: Readonly<{
|
|
getColorScheme(): ColorSchemePreference;
|
|
setColorScheme(
|
|
preference: ColorSchemePreference,
|
|
): ReturnType<StoragePort["write"]>;
|
|
}>;
|
|
diagnostics: Readonly<{
|
|
reportRenderFailure(report: RenderFailureReport): void;
|
|
reportRouteChanged(report: RouteChangedReport): void;
|
|
}>;
|
|
runtime: Readonly<{
|
|
getReleaseSummary(): Promise<ReleaseSummary>;
|
|
}>;
|
|
recovery: Readonly<{
|
|
recoverChunk(input: Readonly<{
|
|
chunkId: string;
|
|
failureKind: "CHUNK_LOAD_FAILURE" | "DEPLOY_MISMATCH";
|
|
}>): Promise<
|
|
| Readonly<{ action: "reload-once"; releasePair: string }>
|
|
| Readonly<{ action: "support"; reason: string }>
|
|
>;
|
|
}>;
|
|
features: Readonly<{
|
|
has(featureId: string): boolean;
|
|
get(featureId: string): unknown;
|
|
}>;
|
|
}>;
|