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.

ServerData

tipo Since 1.1.0

Cómo ven el <script> y la plantilla de una página un export de su código de nivel superior de servidor: el valor ya esperado, tal como llega en el payload y de sólo lectura en profundidad.

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

Source code src/server/runtime/page-body.ts:44

Declaración #

ts
type ServerData<T> = T extends string | number | boolean | bigint | symbol | null | undefined ? T : T extends Deferred<infer U> ? Deferred<ServerData<U>> : T extends (...args: never[]) => unknown ? T : T extends object ? { readonly [K in keyof T]: ServerData<T[K]> } : T

Type parameters #

T

Tipo del export en el bloque <script server>.

Example #

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

type User = ServerData<{ name: string; tags: string[] }>;
// { readonly name: string; readonly tags: { readonly [n: number]: string; ... } }
declare const user: User;
const first = user.tags[0];

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/runtime/page-body.ts