UNPKG

698 BTypeScriptView Raw
1/**
2 * An object of unknown type for route loaders and actions provided by the
3 * server's `getLoadContext()` function. This is defined as an empty interface
4 * specifically so apps can leverage declaration merging to augment this type
5 * globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
6 */
7interface AppLoadContext {
8 [key: string]: unknown;
9}
10
11/**
12 * An augmentable interface users can modify in their app-code to opt into
13 * future-flag-specific types
14 */
15interface Future {
16}
17type MiddlewareEnabled = Future extends {
18 unstable_middleware: infer T extends boolean;
19} ? T : false;
20
21export type { AppLoadContext as A, Future as F, MiddlewareEnabled as M };