Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

PageRequestOf

tipo Since 1.1.0

Tipo de usePage() en una página cuyas opciones de ruta son Route y cuyo ID de ruta es Id: toma params y search de los schemas de Route o, si no los declara, de las rutas generadas. Lo usan las declaraciones que Meeko genera para el bloque <script server>.

ts
import type { PageRequestOf } from "@meekojs/meeko/framework";

Source code src/server/composables/usePage.ts:62

Declaración #

ts
type PageRequestOf<Route, Id extends string = string> = PageRequest<RouteSchema<Route, 'params', IdParams<Id>>, RouteSchema<Route, 'search', Readonly<Record<string, string | string[]>>>>

Type parameters #

Route

Tipo de las opciones de ruta (typeof route), o undefined.

Id extends string = string

ID de la ruta, como "/users/[id]".

Example #

ts
import type { PageRequestOf } from "@meekojs/meeko/framework";

// Con GeneratedRoutes instalado, params es { id: string }.
type UserPage = PageRequestOf<undefined, "/users/[id]">;
declare const page: UserPage;
const id: string = page.params.id;

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/composables/usePage.ts