RouteResolverEntry β
All entries have this union type:
type RouteResolverEntry =
| { kind: "api"; route: ApiRoute }
| { kind: "page"; route: PageRoute };Check the kind property to determine which type you're dealing with.
Common Properties (RouteEntry) β
Both ApiRoute and PageRoute extend RouteEntry with these properties:
id - Unique identifier (e.g., "users_id_67567456")
name - Route name (e.g., "users/[id]")
folder - Either "api" or "pages", indicating which directory the route is in
file - Path to route file, relative to the folder
fileFullpath - Absolute path to the route file
pathTokens - Array of path segments with parameter information
pathPattern - path-to-regexp pattern
PathToken Structure β
Each token in the route path has this structure:
export type PathToken = {
kind:
| "static" // segment is purely static
| "param" // segment is a single pure param (no static parts)
| "mixed"; // segment has both static and param parts
// original segment string, eg. [id] or {name} or {...path}
orig: string;
// path-to-regexp pattern obtained from original segment,
// eg. :id or {/:name} or {/*path}
pattern: string;
// parsed parts of the segment
parts: Array<PathTokenStaticPart | PathTokenParamPart>;
};Static segments have param as undefined. Dynamic segments have param populated with metadata.
ApiRoute Properties β
API routes have additional properties for type information:
params - Route parameter metadata:
id- Type identifier for paramsschema- Array of parameter tokens (subset ofPathTokencontaining only dynamic segments)resolvedType- Flattened type information (ifresolveTypes: true)
numericParams - Names of parameters refined as numbers
optionalParams - Whether route has any optional parameters
methods - HTTP methods this route handles (GET, POST, etc.)
typeDeclarations - Type definitions found in the route file
payloadTypes - Request body type information per method
responseTypes - Response type information per method
referencedFiles - Absolute paths to files this route imports from
PageRoute Properties β
Page routes have simpler parameter information:
params - Route parameter schema:
schema- Array of parameter tokens (subset ofPathTokencontaining only dynamic segments)