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.

ApiQueryContract

tipo Since 1.1.0

Operaciones GET de un contrato de API indexadas por ruta ("/api/users/[id]"), a partir del manifiesto público de la aplicación. Es el tipo que recibe UseApi.

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

Source code src/app/composables/resources/engine.ts:272

Declaración #

ts
type ApiQueryContract<Manifest, Contract> = {
	[E in GetEndpoint<Manifest> as E['pathname']]: GetOperation<Contract, E['clientKey']>
}

Type parameters #

Manifest

Manifiesto público con los endpoints (pathname, method, clientKey).

Contract

Contrato ApiContract generado, indexado por clientKey.

Example #

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

type Contract = { users: { get: { params: undefined; query: undefined; output: string[] } } };
declare const manifest: { readonly api: readonly [{ readonly clientKey: "users"; readonly pathname: "/api/users"; readonly method: "GET" }] };
// Queries["/api/users"] es la operación GET de api.users.
type Queries = ApiQueryContract<typeof manifest, Contract>;

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/composables/resources/engine.ts