Skip to content

API

ogygia/app

Replacements for $app/navigation that are safe to use inside islands.

On this page

This page is generated from the package’s own .d.ts files on every build, so the signatures, descriptions and examples below always match the source.

Exports afterNavigate · beforeNavigate · bust_page_cache · disableScrollHandling · goto · invalidate · invalidateAll · preloadCode · preloadData · spa_html_cacheable · AfterNavigation · BeforeNavigation · NavTarget · AfterNavigateCallback · BeforeNavigateCallback

import { … } from 'ogygia/app';

afterNavigate

function

function afterNavigate(fn: AfterNavigateCallback): () => void;

beforeNavigate

function

function beforeNavigate(fn: BeforeNavigateCallback): () => void;

bust_page_cache

function

ogygia/app's bust_page_cache: drop the SPA router's warmed page HTML (after mutations / auth changes). A no-op without the router — there is no page cache.

function bust_page_cache(): void;

disableScrollHandling

function

function disableScrollHandling(): void;

goto

function

function goto(url: string | URL, opts?: {
  replaceState?: boolean;
  external?: boolean;
}): Promise<void>;

invalidate

function

function invalidate(resource?: unknown): Promise<void>;

invalidateAll

function

function invalidateAll(): Promise<void>;

preloadCode

function

function preloadCode(url?: string): Promise<void>;

preloadData

function

function preloadData(url: string | URL): Promise<unknown>;

spa_html_cacheable

function

Whether a fetch response may warm the SPA page-HTML cache.

  • cacheControl — Response Cache-Control header value.
  • setCookie — True if the response included Set-Cookie.

Returns False when the response is private / no-store / no-cache or set a cookie.

function spa_html_cacheable(cacheControl: string, setCookie: boolean): boolean;

AfterNavigation

interface

Payload for afterNavigate callbacks.

AfterNavigation.from

AfterNavigation.to

AfterNavigation.type

AfterNavigation.willUnload

interface AfterNavigation {/*…*/}
from: NavTarget | null;
to: NavTarget;
type: string;
willUnload: boolean;

BeforeNavigation

interface

Payload for beforeNavigate callbacks.

BeforeNavigation.from

BeforeNavigation.to

BeforeNavigation.type

BeforeNavigation.cancel

BeforeNavigation.willUnload

interface BeforeNavigation {/*…*/}
from: NavTarget;
to: NavTarget;
type: string;
cancel: () => void;
willUnload: boolean;

interface

Resolved navigation target (URL + Kit-shaped stubs for params/route).

AfterNavigateCallback

type

Callback registered with afterNavigate.

type AfterNavigateCallback = (nav: AfterNavigation) => void;

BeforeNavigateCallback

type

Callback registered with beforeNavigate.

type BeforeNavigateCallback = (nav: BeforeNavigation) => void;