createValidatedFetch
createValidatedFetch<
T>(validator,fetchFn?):ValidatedFetch<T>
Defined in: wp-typia-rest/src/client.ts:370
Create a validated WordPress-aware fetch helper.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”validator
Section titled “validator”(input) => ValidationLike<T>
Response validator, typically a Typia-generated function.
fetchFn?
Section titled “fetchFn?”ApiFetch = ...
Optional @wordpress/api-fetch compatible implementation.
Returns
Section titled “Returns”A helper that can fetch, assert, or soft-check response payloads.
Example
Section titled “Example”const postsFetch = createValidatedFetch(validatePosts);const result = await postsFetch.fetch({ path: "/wp/v2/posts" });