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.

PageSchema

interfaz

Subconjunto de Standard Schema v1 que se puede usar en el navegador, como el que implementan los schemas de Valibot. Valida params y search de una página.

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

Source code src/app/definitions/define-page.ts:23

Declaración #

ts
interface PageSchema<I = unknown, O = I> {
	readonly '~standard': {
		readonly version: 1
		readonly validate: (value: unknown) => { value: O; issues?: undefined } | { issues: readonly unknown[] } | Promise<{ value: O; issues?: undefined } | { issues: readonly unknown[] }>
		readonly types?: { readonly input: I; readonly output: O } | undefined
	}
}

Type parameters #

I = unknown

Tipo de entrada.

O = I

Tipo de salida, tras validar y transformar.

Example #

ts
import * as v from "valibot";
import type { PageSchema } from "@meekojs/meeko/framework";

const params: PageSchema<{ id: string }> = v.object({ id: v.string() });

Propiedades #

~standard #

propiedad sólo lectura

readonly '~standard': {
	readonly version: 1
	readonly validate: (value: unknown) => { value: O; issues?: undefined } | { issues: readonly unknown[] } | Promise<{ value: O; issues?: undefined } | { issues: readonly unknown[] }>
	readonly types?: { readonly input: I; readonly output: O } | undefined
}

Interfaz Standard Schema v1: validate devuelve el valor de salida o la lista de issues.

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/app/definitions/define-page.ts