@rnaga/wp-node
Version:
👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**
23 lines • 1.23 kB
TypeScript
import { z } from "zod";
import { Config } from "../../config";
import * as val from "../../validators";
import { Comment } from "../comment";
import { Components } from "../components";
import { Post } from "../post";
import type * as types from "../../types";
export declare class CommentUtil {
private components;
private config;
constructor(components: Components, config: Config);
get(id: number): Promise<Comment>;
toComment(comment: types.Tables["comments"]): Comment;
toComments(comments: types.Tables["comments"][]): Comment[];
getDefaultStatus(postType?: types.PostType, commentType?: string): Promise<"open" | "closed">;
getDefaultStatus(postType?: string, commentType?: string): Promise<"open" | "closed">;
getStatusAsString(commentId: number): Promise<"trash" | "" | "spam" | "approved" | "unapproved">;
isOpen(post: Post): boolean | undefined;
containsNGWord(args: Partial<types.Tables["comments"]>): Promise<boolean>;
isValid(args: Partial<types.Tables["comments"]>): Promise<boolean>;
getStatus(comment: Partial<types.Tables["comments"]>): Promise<z.infer<typeof val.database.wpComments.shape.comment_approved>>;
}
//# sourceMappingURL=comment.util.d.ts.map