UNPKG

@rnaga/wp-node

Version:

👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**

35 lines • 2.15 kB
import { Alias } from "./alias"; import { QueryBuilder } from "./query-builder"; import { QueryBuilders } from "./query-builders"; import type * as types from "../types"; type ShortColumn<T extends string> = `comment_${T}` extends types.Columns<"comments"> ? T : never; type AllShortColumns = types.Columns<"comments"> extends `${string}_${infer C}` ? C : never; export declare class CommentsQuery extends QueryBuilder<CommentsQuery> { #private; alias: Alias<"cte" | "c" | "c2" | "pto">; protected builders: QueryBuilders; builder: types.QueryBuilder; readonly table = "comments"; constructor(alias: Alias<"cte" | "c" | "c2" | "pto">, builders: QueryBuilders, builder: types.QueryBuilder); get from(): this; get parent(): CommentsQuery | undefined; get children(): CommentsQuery; get(id: number): this; countApproved(postId: number): this; withMeta(type?: "inner" | "right"): this; withPosts(ids?: number[], type?: "inner" | "left"): this; withUsers(userIds?: number[], type?: "inner" | "left"): this; withParent(): this; withChildren(column: types.Columns<"comments">, obj: Array<string | number>, limit?: number): this; withStatus(status: "hold" | "approve" | "all"): this; withType<T extends string = "comment">(type: "comment" | "comments" | "pings" | T): this; select(columns: "*" | Array<AllShortColumns | `parent_${AllShortColumns}` | `user_${types.Columns<"users">}` | "user_id" | "meta_key" | "meta_value" | "depth" | "*">): this; whereLike(column: ShortColumn<"author" | "author_email" | "author_url" | "author_IP" | "content">, search: string | number, options?: { not: boolean; }): this; whereNotLike(column: ShortColumn<"author" | "author_email" | "author_url" | "author_IP" | "content">, search: string | number): this; whereIn(column: AllShortColumns | "user_id" | "meta_key" | "meta_value", values: Array<number | string>): this; where(column: AllShortColumns | "user_id" | "meta_key" | "meta_value", value: string | number | Array<string | number>, op?: string): this; } export {}; //# sourceMappingURL=comments.query.d.ts.map