///
= (query?: URLSearchParams | number, ...ids: number[]) => Promise<(P | null)[]>; export type EndpointFindAll
= (query?: URLSearchParams) => Promise
; export type EndpointFindOnly
= () => Promise
; export type EndpointCreate
= (body: Partial
) => Promise
; export type EndpointDelete
= (...ids: number[]) => Promise<(P | null)[]>; export type EndpointDeleteUntrashable
= (...ids: number[]) => Promise<({ deleted: boolean; previous: P; } | null)[]>; export type EndpointUpdate
= (body: Partial
, id: number) => Promise
; export type EndpointUpdateMedia
= (body: Partial ;
export type EndpointTotal = () => Promise = (body: Partial ) => Promise ;
export interface DefaultEndpoint {
create: EndpointCreate ;
find: EndpointFind ;
update: EndpointUpdate ;
delete: EndpointDelete ;
dangerouslyFindAll: EndpointFindAll ;
total: EndpointTotal;
}
export interface DefaultEndpointWithRevision {
create: EndpointCreate ;
find: EndpointFind ;
update: EndpointUpdate ;
delete: EndpointDelete ;
dangerouslyFindAll: EndpointFindAll ;
total: EndpointTotal;
revision: (postId: number) => {
create: EndpointCreate ;
find: EndpointFind ;
update: EndpointUpdate ;
delete: EndpointDelete ;
};
}
export interface ACFBase {
acf: A;
}
export interface YoastBase {
yoast_head_json?: YoastHead;
}
export type WPPost = WP_REST_API_Post & ACFBase & YoastBase;
export type WPMedia = WP_REST_API_Attachment & ACFBase & YoastBase;
export type WPPage = WPPost & {
menu_order: number;
parent: number;
};
export type WPTaxonomy = WP_REST_API_Taxonomy & ACFBase & YoastBase;
export type WPCategory = WP_REST_API_Category & ACFBase & YoastBase;
export type WPComment = WP_REST_API_Comment & ACFBase & YoastBase;
export type WPTag = WP_REST_API_Tag & ACFBase & YoastBase;
export type WPUser = WP_REST_API_User & ACFBase;
export interface WPPlugin {
plugin: string;
status: string;
name: string;
plugin_uri: string;
author: string;
author_uri: string;
description: {
raw: string;
rendered: string;
};
version: string;
network_only: boolean;
requires_wp: string;
requires_php: string;
textdomain: string;
_links: {
self?: {
href: string;
}[] | null;
};
}
export interface WPThemeEditorColor {
name: string;
slug: string;
color: string;
}
export interface WPThemeEditorFontSize {
name: string;
size: number;
slug: string;
}
export interface WPThemeEditorGradientPreset {
name: string;
gradient: string;
slug: string;
}
export interface WPThemeSupports {
'align-wide': boolean;
'automatic-feed-links': boolean;
'custom-background': {
'default-image': string;
'default-preset': string;
'default-position-x': string;
'default-position-y': string;
'default-size': string;
'default-repeat': string;
'default-attachment': string;
'default-color': string;
};
'custom-header': boolean;
'custom-logo': {
'width': number;
'height': number;
'flex-width': boolean;
'flex-height': boolean;
'header-text'?: (string | null)[];
'unlink-homepage-logo': boolean;
};
'customize-selective-refresh-widgets': boolean;
'dark-editor-style': boolean;
'disable-custom-colors': boolean;
'disable-custom-font-sizes': boolean;
'disable-custom-gradients': boolean;
'editor-color-palette'?: WPThemeEditorColor[];
'editor-font-sizes'?: WPThemeEditorFontSize[];
'editor-gradient-presets'?: WPThemeEditorGradientPreset[];
'editor-styles': boolean;
'html5'?: string[];
'formats'?: string[];
'post-thumbnails': boolean;
'responsive-embeds': boolean;
'title-tag': boolean;
'wp-block-styles': boolean;
}
export interface WPTheme {
stylesheet: string;
template: string;
requires_php: string;
requires_wp: string;
textdomain: string;
version: string;
screenshot: string;
author: {
raw: string;
rendered: string;
};
author_uri: {
raw: string;
rendered: string;
};
description: {
raw: string;
rendered: string;
};
name: {
raw: string;
rendered: string;
};
tags: {
raw?: (string | null)[];
rendered: string;
};
theme_uri: {
raw: string;
rendered: string;
};
status: string;
theme_supports?: WPThemeSupports;
_links: {
self?: {
href: string;
}[];
collection?: {
href: string;
}[];
};
}
export type WpRestApiContext = 'view' | 'embed' | 'edit';
export interface PluginCreateDto {
plugin: string;
status?: 'active' | 'inactive';
}
export interface PluginUpdateDto {
status?: 'active' | 'inactive';
context?: WpRestApiContext;
}
export interface RenderedBlockDto {
name: string;
postId: number;
context?: 'edit' | 'view';
attributes?: string[];
}
export declare enum AUTH_TYPE {
BASIC = "basic",
JWT = "jwt",
NONCE = "nonce",
NONE = "none"
}
interface AuthOptionBasic {
type: AUTH_TYPE.BASIC | 'basic';
username: string;
password: string;
}
interface AuthOptionJwt {
type: AUTH_TYPE.JWT | 'jwt';
token: string;
}
interface AuthOptionNonce {
type: AUTH_TYPE.NONCE | 'nonce';
nonce: string;
}
interface AuthOptionNone {
type: AUTH_TYPE.NONE | 'none';
}
type AuthOptions = AuthOptionBasic | AuthOptionJwt | AuthOptionNonce | AuthOptionNone;
export interface WpApiOptions {
auth?: AuthOptions;
headers?: Record