import snoowrap from 'snoowrap'; import DBSubmission from "../database/entities/db-submission"; import DBComment from "../database/entities/db-comment"; declare type DBTypeConversion = T extends snoowrap.Submission ? DBSubmission : DBComment; declare type Post = snoowrap.Submission | snoowrap.Comment; export declare const TimeRange: string[]; export declare type TimeRange = 'hour' | 'day' | 'week' | 'month' | 'year' | 'all'; export declare const SubredditSorts: string[]; export declare type SubredditSorts = 'hot' | 'new' | 'top' | 'rising'; /** * Creates a generator which reads every post from the given Listing, requesting more from Reddit until it runs out. */ export declare function readListing(listing: snoowrap.Listing, limit?: number): AsyncGenerator, number, unknown>; /** * Get all posts saved by the current user. */ export declare function getSavedPosts(): AsyncGenerator; /** * Get all Submissions upvoted by the current user. */ export declare function getUpvoted(): AsyncGenerator; /** * Get all Submissions upvoted by the current user. */ export declare function getSubreddit(subreddit: string, type: SubredditSorts, time: TimeRange, limit: number): AsyncGenerator; export declare const getSubmission: (id: string) => Promise; export declare const getComment: (id: string) => Promise; /** * Pick the given values into a new Object. * If any values are missing initially, the object's `fetch()` method will be awaited before continuing. * @param obj * @param keys */ export declare function picker(obj: T, keys: K[]): Promise<{ [key in K]: T[key]; }>; /** * Convert the given snoo-wrapper object into a fully-resolved Database object, which can be saved and loaded. * @param post */ export declare function toDBO>(post: T): Promise; /** * Check if the given string represents a Submission ID ("name" in reddit API terms). * @param id */ export declare function isSubmissionID(id: string): boolean; export {};