SerializableExport
tipo Desde 1.1.0
Comprobación de tipos que falla cuando un export del código de nivel superior de servidor no se
puede serializar en JSON. Shape es JsonShape<T>. El compilador la genera para cada export.
ts
import type { SerializableExport } from "@meekojs/meeko/framework";Código fuente src/server/runtime/page-body.ts:82
Declaración #
ts
type SerializableExport<T extends Shape, Shape> = TParámetros de tipo #
-
Textends Shape Tipo del export.
-
Shape Su forma JSON,
JsonShape<T>.
Ejemplo #
ts
import type { JsonShape, SerializableExport } from "@meekojs/meeko/framework";
type User = { id: string; joined: string };
type Checked = SerializableExport<User, JsonShape<User>>; // User
// SerializableExport<{ at: Date }, JsonShape<{ at: Date }>> no compila: Date es una clase.