Skip to content

Interface: ConnectRouterOptions

API / @xmachines/play-sveltekit-router / ConnectRouterOptions

Defined in: play-sveltekit-router/src/connect-router.ts:8

The options of SvelteKitRouterBridge.

Extends

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
actorreadonlyRoutableActor--play-sveltekit-router/src/connect-router.ts:9
basePath?readonlystringThe URL prefix that the routes of the machine hang off, for example "/admin" or "/:machineId/play". A :param segment is a declarative convenience, so that a host keeps ONE string that mirrors its own route config. Every :param must have a value in BasePathOptions.basePathParams, because the bridge writes a real URL. An optional segment (:param?) and a wildcard (*) are therefore refused: neither of them resolves to one concrete prefix. An absent value, "", and "/" all mean “no prefix”.SvelteKitRouterBridgeOptions.basePathplay-url/src/base-path.ts:62
basePathParams?readonlyRecord<string, string | number>The values of the :param segments of BasePathOptions.basePath. These values belong to the HOST, which wrote the prefix and resolved them, so they travel in NO play.route event: the machine is authoritative over its own params, and event.params holds what the pattern of the machine declares, and nothing else. A param of the host that shares a name with one of the machine can therefore shadow it never. A host reads them back from bridge.basePathParams, where they cannot go stale. A machine that needs the identity of its host takes it through the input of the actor, where that identity decides WHICH machine runs.SvelteKitRouterBridgeOptions.basePathParamsplay-url/src/base-path.ts:76
compiledCache?readonlyKeyValueCache<URLPatternLike>The cache of the COMPILED URLPattern, which is what this function returns. The default is a cache that this module shares with every caller of the process. Pass one to give a tenant or a request a compilation that no other evicts, and pass { get: () => undefined, set: () => {} } to compile each time. A caller that passes patternCache for isolation passes this one too. The compiled cache is read FIRST, so a hit on it answers before the parse runs at all — a passed parse cache alone therefore isolates nothing once another caller has compiled the same pattern.SvelteKitRouterBridgeOptions.compiledCacheplay-url/src/url-pattern-utils.ts:119
location?readonlyLocationLike | nullThe location-like object for the initial URL reads. The default is globalThis.location. Give a mock in a test, or a stub in an SSR environment.-play-sveltekit-router/src/connect-router.ts:16
patternCache?readonlyKeyValueCache<ParsedPattern>The cache of the PARSE of a pattern. The default is the cache that this package shares with every caller of the process.SvelteKitRouterBridgeOptions.patternCacheplay-pattern/src/cache.ts:41
routeMapreadonlyRouteMap--play-sveltekit-router/src/connect-router.ts:10
shallow?readonlyShallowNavigationWhat the bridge does with a shallow navigation. The default is "ignore". See ShallowNavigationSvelteKitRouterBridgeOptions.shallowplay-sveltekit-router/src/sveltekit-router-bridge.ts:47