Skip to content

@vowel.to/client v0.1.2-393


@vowel.to/client / index / NavigationAdapter

Interface: NavigationAdapter

Defined in: lib/vowel/types/types.ts:66

Navigation adapter interface for voice-controlled routing

Handles WHERE to go in your application. This adapter is responsible for navigating between pages/routes based on voice commands.

Example

ts
// Direct navigation in SPAs
const navigationAdapter = new DirectNavigationAdapter({
  navigate: (path) => router.push(path),
  getCurrentPath: () => router.pathname
});

// Controlled navigation for traditional sites
const navigationAdapter = new ControlledNavigationAdapter({
  channelName: 'vowel-nav'
});

Methods

ts
navigate(path): Promise<void>;

Defined in: lib/vowel/types/types.ts:71

Navigate to a specific path

Parameters

ParameterTypeDescription
pathstringThe path to navigate to (e.g., "/products", "/cart")

Returns

Promise<void>


getCurrentPath()

ts
getCurrentPath(): string;

Defined in: lib/vowel/types/types.ts:77

Get the current path

Returns

string

Current path (e.g., "/products")


getRoutes()?

ts
optional getRoutes(): Promise<VowelRoute[]>;

Defined in: lib/vowel/types/types.ts:83

Optional: Get available routes

Returns

Promise<VowelRoute[]>

Array of routes that can be navigated to


getContext()?

ts
optional getContext(): any;

Defined in: lib/vowel/types/types.ts:88

Optional: Get additional context about the router

Returns

any