Rindle

API index and search · Build metadata

Supporting declarations

packages/tanstack/src/index.ts. These declarations explain referenced types. Only package-page symbols are package exports.

Exact source

RINDLE_LOADER_DATA_KEY

/** The loader-data field serialized by TanStack Start and consumed by {@link Provider}. */
export declare const RINDLE_LOADER_DATA_KEY: "rindle";

RindleLoaderContext

/** The stable subset of TanStack's loader context exposed to route query factories. TanStack passes
 *  a richer object at runtime; keeping this structural avoids coupling the adapter to a generated
 *  router's route-tree generics while still contextually typing the common fields. */
export interface RindleLoaderContext {
    abortController: AbortController;
    preload: boolean;
    params: Record<string, string>;
    deps: Record<string, unknown>;
    context: unknown;
    location: unknown;
    cause: "preload" | "enter" | "stay";
}

RindleLoaderData

export interface RindleLoaderData {
    rindle: DehydratedState;
}

RindleTanStackClient

export interface RindleTanStackClient<S extends ColsMap> extends QueryEnsurer {
    store: Store<S>;
}

RindleTanStackOptions

export interface RindleTanStackOptions<S extends ColsMap> {
    schema: Schema<S>;
    /** Browser-only lazy client boot. The adapter calls it at most once and shares that client
     *  between route loaders and the provider. It is never called during SSR. */
    boot: () => Promise<RindleTanStackClient<S>>;
    /** Server-side named-query preload. A dynamic implementation keeps server authority code out of
     *  the browser bundle; the full loader context is forwarded for request-scoped auth/policy. */
    preload: (queries: readonly AnyQuery[], context: RindleLoaderContext) => Promise<DehydratedState>;
}

QueryList

type QueryList = AnyQuery | readonly AnyQuery[];

RindleRouteLoaderOptions

export interface RindleRouteLoaderOptions<Context extends RindleLoaderContext = RindleLoaderContext> {
    /** Query (or queries) that blocks client route entry and is always included in the SSR seed. */
    query?: (context: Context) => QueryList;
    /** Additional queries needed for SSR first paint but not worth blocking client navigation on. */
    ssr?: (context: Context) => QueryList;
    /** Client readiness policy for `query`. Defaults to local-first `present`; set `complete` when
     *  route entry must wait for a server-authoritative result. */
    until?: EnsureQueryUntil;
}

RindleRouteLoader

export interface RindleRouteLoader<Context extends RindleLoaderContext = RindleLoaderContext> {
    handler(context: Context): Promise<RindleLoaderData>;
    /** Re-entry must not commit a stale match while its Rindle query is being warmed. */
    staleReloadMode: "blocking";
}

RindleProviderProps

export interface RindleProviderProps {
    children?: ReactNode;
}

RindleTanStackIntegration

export interface RindleTanStackIntegration<S extends ColsMap> {
    loader<Context extends RindleLoaderContext = RindleLoaderContext>(options: RindleRouteLoaderOptions<Context>): RindleRouteLoader<Context>;
    Provider(props: RindleProviderProps): ReturnType<typeof createElement>;
}

createRindleTanStack

/**
 * Bind one Rindle client/server pair to TanStack Router. The returned `loader` is used by routes;
 * `Provider` replaces the app's manual `useMatches()` dehydration merge plus `<RindleSSR>` glue.
 */
export declare function createRindleTanStack<S extends ColsMap>(options: RindleTanStackOptions<S>): RindleTanStackIntegration<S>;

mergeRindleLoaderData

/** Merge the serialized Rindle slice from every matched route. Exported for custom providers/tests. */
export declare function mergeRindleLoaderData(loaderData: readonly unknown[]): DehydratedState;