Docs
Types

WP_EndpointInput

Extract the input accepted by a generated WordPress endpoint.

WP_EndpointInput<Path> resolves the first argument accepted by an endpoint in the active generated introspection. Use it when a helper or service forwards the same input as that endpoint.

Prop

Type

import type { WP_EndpointInput } from "kizlo"

export type PostListInput = WP_EndpointInput<"postTypes.post.list">

export function featuredInput(input: PostListInput): PostListInput {
  return { ...input, sticky: true }
}

The path resolves against the project compiling the code, so a changed WordPress route updates every alias on the next generation.