import type { Comment, PostOption, Posts } from '../types';
import * as schema from '../constants/redis';
import { type RedisDefaultClient } from './redis';
export type PostRawDocument = {
    readonly id: string;
    readonly title: string;
    readonly content: string;
    readonly created_by: string;
    readonly created_at: Date;
    readonly updated_at: Date;
};
export type PostDocument = Omit<PostRawDocument, 'created_at' | 'updated_at'> & {
    readonly created_at: number;
    readonly updated_at: number;
    readonly _raw: string;
    readonly _scope: string;
};
export type CommentRawDocument = {
    readonly id: string;
    readonly content: string;
    readonly created_by: string;
    readonly created_at: Date;
    readonly updated_at: Date;
};
export type CommentDocument = Omit<CommentRawDocument, 'created_at' | 'updated_at'> & {
    readonly created_at: number;
    readonly updated_at: number;
    readonly _raw: string;
    readonly _scope: string;
    readonly _post_id: string;
};
export type ReactionRawDocument = {
    readonly content: string;
    readonly created_by: string;
};
export type ReactionDocument = ReactionRawDocument & {
    readonly _scope: string;
    readonly _post_id: string;
};
export type ReactionDocumentWithId = ReactionDocument & {
    readonly id: string;
};
export type OptionRawDocument = PostOption;
export type OptionDocument = Omit<OptionRawDocument, 'value'> & {
    readonly value: string;
    readonly _raw: string;
    readonly _parent_type: 'post' | 'comment';
    readonly _parent_id: string;
    readonly _scope: string;
};
export declare const postDocument: ({ data, scope, }: {
    readonly data: PostRawDocument;
    readonly scope: string;
}) => PostDocument;
export declare const commentDocument: ({ data, scope, postId, }: {
    readonly data: CommentRawDocument;
    readonly scope: string;
    readonly postId: string;
}) => CommentDocument;
export declare const reactionDocument: ({ data, scope, postId, }: {
    readonly data: ReactionRawDocument;
    readonly scope: string;
    readonly postId: string;
}) => ReactionDocument;
export declare const optionDocument: ({ data, scope, parentType, parentId, }: {
    readonly data: OptionRawDocument;
    readonly scope: string;
    readonly parentType: OptionDocument['_parent_type'];
    readonly parentId: string;
}) => OptionDocument;
export declare const generatePrefixOf: (prefix: schema.Prefix, scope: string) => string;
export declare const generateKeyOf: (prefix: schema.Prefix, scope: string, id: string) => string;
export declare const createIndex: (client: RedisDefaultClient) => Promise<[{
    result: "OK";
    name: string;
} | {
    result: string;
    name: string;
}, {
    result: "OK";
    name: string;
} | {
    result: string;
    name: string;
}, {
    result: "OK";
    name: string;
} | {
    result: string;
    name: string;
}, {
    result: "OK";
    name: string;
} | {
    result: string;
    name: string;
}]>;
export declare const setPost: ({ scope, post, url, client, }: {
    readonly scope: string;
    readonly post: Posts;
    readonly url: string;
    readonly client: RedisDefaultClient;
}) => Promise<boolean>;
export declare const deletePost: ({ postId, client, scope, userAddress, }: {
    readonly scope: string;
    readonly postId: string;
    readonly client: RedisDefaultClient;
    readonly userAddress: string;
}) => Promise<boolean>;
export declare const setReaction: ({ scope, reaction, postId, url, client, createdBy, }: {
    readonly scope: string;
    readonly reaction: string;
    readonly postId: string;
    readonly url: string;
    readonly client: RedisDefaultClient;
    readonly createdBy: string;
}) => Promise<boolean>;
export declare const implSetReaction: ({ scope, reaction, postId, url, client, createdBy, }: {
    readonly scope: string;
    readonly reaction: string;
    readonly postId: string;
    readonly url: string;
    readonly client: RedisDefaultClient;
    readonly createdBy: string;
}) => Promise<void>;
export declare const setComment: ({ scope, comment, postId, url, client, }: {
    readonly scope: string;
    readonly comment: Comment;
    readonly postId: string;
    readonly url: string;
    readonly client: RedisDefaultClient;
}) => Promise<boolean>;
export declare const deleteComment: ({ scope, parentType, commentId, client, }: {
    readonly scope: string;
    readonly commentId: string;
    readonly parentType: OptionDocument['_parent_type'];
    readonly client: RedisDefaultClient;
}) => Promise<boolean>;
/**
 * Fetch paginated comments related to the parent post
 * @param scope - the associated db scope
 * @param postId - the parent post id
 * @param client - the redis client
 * @param page - the page number
 * @returns the comments
 */
export declare const fetchComments: ({ scope, postId, client, page, }: {
    readonly scope: string;
    readonly postId: string;
    readonly client: RedisDefaultClient;
    readonly page?: number | undefined;
}) => Promise<CommentDocument[]>;
/**
 * Fetch all options related to the parent post/comment
 * @param scope - the associated db scope
 * @param parentId - the parent post/comment id
 * @param parentType - post or comment
 * @param client - the redis client
 * @param page - the page number
 * @returns the comments
 */
export declare const fetchAllOptions: ({ scope, parentId, parentType, client, }: {
    readonly scope: string;
    readonly parentId: OptionDocument['_parent_id'];
    readonly parentType: OptionDocument['_parent_type'];
    readonly client: RedisDefaultClient;
}) => Promise<readonly OptionDocument[]>;
/**
 * Fetch all reactions related to the parent post
 * @param scope - the associated db scope
 * @param postId - the parent post id
 * @param client - the redis client
 * @param page - the page number
 * @returns the comments
 */
export declare const fetchAllReactions: ({ scope, postId, client, }: {
    readonly scope: string;
    readonly postId: string;
    readonly client: RedisDefaultClient;
}) => Promise<readonly ReactionDocumentWithId[]>;
