@rnaga/wp-node
Version:
👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**
43 lines • 3.82 kB
TypeScript
import { z } from "zod";
import { Config } from "../config";
import { Components } from "../core/components";
import * as val from "../validators";
import { Crud } from "./crud";
declare const allowedOptions: {
general: readonly ["blogname", "blogdescription", "gmt_offset", "date_format", "time_format", "start_of_week", "timezone_string", "admin_email"];
discussion: readonly ["default_pingback_flag", "default_ping_status", "default_comment_status", "comments_notify", "moderation_notify", "comment_moderation", "require_name_email", "comment_previously_approved", "comment_max_links", "moderation_keys", "disallowed_keys", "show_avatars", "avatar_rating", "avatar_default", "close_comments_for_old_posts", "close_comments_days_old", "thread_comments", "thread_comments_depth", "page_comments", "comments_per_page", "default_comments_page", "comment_order", "comment_registration", "show_comments_cookies_opt_in"];
media: readonly ["thumbnail_size_w", "thumbnail_size_h", "thumbnail_crop", "medium_size_w", "medium_size_h", "large_size_w", "large_size_h", "image_default_size", "image_default_align", "image_default_link_type"];
reading: readonly ["posts_per_page", "posts_per_rss", "rss_use_excerpt", "show_on_front", "page_on_front", "page_for_posts", "blog_public"];
writing: readonly ["default_category", "default_email_category", "default_link_category", "default_post_format"];
};
type AllowedOptions = {
general: readonly ((typeof allowedOptions.general)[number] | "users_can_register" | "default_role")[];
discussion: readonly (typeof allowedOptions.discussion)[number][];
media: readonly (typeof allowedOptions.media)[number][];
reading: readonly (typeof allowedOptions.reading)[number][];
writing: readonly (typeof allowedOptions.writing)[number][];
};
type AllowedOptionKeys = AllowedOptions[keyof AllowedOptions][number][];
export declare class OptionsCrud extends Crud {
private config;
constructor(components: Components, config: Config);
private checkPermission;
getAll(options?: Parameters<OptionsCrud["get"]>[1]): Promise<{
data: Record<"blogname" | "blogdescription" | "users_can_register" | "admin_email" | "start_of_week" | "require_name_email" | "comments_notify" | "posts_per_rss" | "rss_use_excerpt" | "default_category" | "default_comment_status" | "default_ping_status" | "default_pingback_flag" | "posts_per_page" | "date_format" | "time_format" | "comment_moderation" | "moderation_notify" | "moderation_keys" | "comment_max_links" | "gmt_offset" | "default_email_category" | "comment_registration" | "default_role" | "blog_public" | "default_link_category" | "show_on_front" | "show_avatars" | "avatar_rating" | "thumbnail_size_w" | "thumbnail_size_h" | "thumbnail_crop" | "medium_size_w" | "medium_size_h" | "avatar_default" | "large_size_w" | "large_size_h" | "image_default_link_type" | "image_default_size" | "image_default_align" | "close_comments_for_old_posts" | "close_comments_days_old" | "thread_comments" | "thread_comments_depth" | "page_comments" | "comments_per_page" | "default_comments_page" | "comment_order" | "timezone_string" | "page_for_posts" | "page_on_front" | "default_post_format" | "show_comments_cookies_opt_in" | "disallowed_keys" | "comment_previously_approved", any>;
info: undefined;
}>;
get<T extends keyof AllowedOptions, K extends T extends keyof AllowedOptions ? AllowedOptions[T] : AllowedOptionKeys>(key?: T, options?: Partial<{
blogId: number;
}>): Promise<{
data: Record<K[number], any>;
info: undefined;
}>;
update(input: Partial<z.infer<typeof val.options>>, options?: Partial<{
blogId: number;
}>): Promise<{
data: boolean;
info: undefined;
}>;
}
export {};
//# sourceMappingURL=options.crud.d.ts.map