export interface NavigationGuardOptions { /** Whether the current form or editor has unsaved changes */ isDirty: boolean; /** Whether guarding is enabled (defaults to true) */ enabled?: boolean; /** Callback fired when an internal navigation attempt is intercepted */ onBlocked?: (url: string) => void; } export interface NavigationGuardActionReturn { update(newOptions: NavigationGuardOptions): void; destroy(): void; } /** * Svelte action to guard against navigation when there are unsaved changes. * Attaches beforeunload to window and intercepts internal anchor clicks on the element. * * Usage: *