import { RichTextBuilder } from '@devvit/shared-types/richtext/RichTextBuilder.js';
import type { T2ID, T3ID, T5ID } from '@devvit/shared-types/tid.js';
import type { CommentSubmissionOptions } from './Comment.js';
import { Comment } from './Comment.js';
import type { ListingFetchOptions } from './Listing.js';
import { Listing } from './Listing.js';
import { User } from './User.js';
export type GetPostsOptions = ListingFetchOptions & {
    subredditName?: string;
};
export type GetPostsOptionsWithTimeframe = GetPostsOptions & {
    timeframe?: 'hour' | 'day' | 'week' | 'month' | 'year' | 'all';
};
export type GetSortedPostsOptions = GetPostsOptionsWithTimeframe & {
    sort: 'top' | 'controversial';
};
export type GetHotPostsOptions = GetPostsOptions & {
    location?: 'GLOBAL' | 'US' | 'AR' | 'AU' | 'BG' | 'CA' | 'CL' | 'CO' | 'HR' | 'CZ' | 'FI' | 'FR' | 'DE' | 'GR' | 'HU' | 'IS' | 'IN' | 'IE' | 'IT' | 'JP' | 'MY' | 'MX' | 'NZ' | 'PH' | 'PL' | 'PT' | 'PR' | 'RO' | 'RS' | 'SG' | 'ES' | 'SE' | 'TW' | 'TH' | 'TR' | 'GB' | 'US_WA' | 'US_DE' | 'US_DC' | 'US_WI' | 'US_WV' | 'US_HI' | 'US_FL' | 'US_WY' | 'US_NH' | 'US_NJ' | 'US_NM' | 'US_TX' | 'US_LA' | 'US_NC' | 'US_ND' | 'US_NE' | 'US_TN' | 'US_NY' | 'US_PA' | 'US_CA' | 'US_NV' | 'US_VA' | 'US_CO' | 'US_AK' | 'US_AL' | 'US_AR' | 'US_VT' | 'US_IL' | 'US_GA' | 'US_IN' | 'US_IA' | 'US_OK' | 'US_AZ' | 'US_ID' | 'US_CT' | 'US_ME' | 'US_MD' | 'US_MA' | 'US_OH' | 'US_UT' | 'US_MO' | 'US_MN' | 'US_MI' | 'US_RI' | 'US_KS' | 'US_MT' | 'US_MS' | 'US_SC' | 'US_KY' | 'US_OR' | 'US_SD';
};
export type GetPostsByUserOptions = {
    username: string;
    sort?: 'hot' | 'new' | 'top' | 'controversial';
    timeframe?: 'hour' | 'day' | 'week' | 'month' | 'year' | 'all';
    pageSize?: number;
    limit?: number;
    after?: string;
    before?: string;
};
export type PostSuggestedCommentSort = 'BLANK'
/** "Best" sort. */
 | 'CONFIDENCE' | 'CONTROVERSIAL' | 'LIVE'
/** Sort comments by creation time. */
 | 'NEW' | 'OLD'
/** Similar to the "best" (confidence) sort, but specially designed for
  Q&A-type threads to highlight good question/answer pairs. */
 | 'QA' | 'RANDOM'
/** Sort by top upvoted comments. */
 | 'TOP';
export type PostTextOptions = {
    text: string;
} | {
    richtext: object | RichTextBuilder;
};
export type CustomPostRichTextFallback = RichTextBuilder | string;
export type CustomPostTextFallbackOptions = {
    /**
     * May also include markdown. See https://www.reddit.com/r/reddit.com/wiki/markdown/
     */
    text: string;
} | {
    richtext: CustomPostRichTextFallback;
};
export type SubmitLinkOptions = CommonSubmitPostOptions & {
    url: string;
    /**
     * @deprecated Unsupported. This property is for backwards compatibility and
     * has no effect. It will removed in a future version. New code should not
     * use it.
     */
    resubmit?: boolean;
};
export type SubmitMediaOptions = CommonSubmitPostOptions & {
    kind: 'image' | 'video' | 'videogif';
    videoPosterUrl: string;
};
export type SubmitSelfPostOptions = PostTextOptions & CommonSubmitPostOptions;
export type SubmitCustomPostTextFallbackOptions = {
    textFallback?: CustomPostTextFallbackOptions;
};
export type SubmitCustomPostOptions = CommonSubmitPostOptions & SubmitCustomPostTextFallbackOptions & {
    preview: JSX.Element;
};
export type CommonSubmitPostOptions = {
    title: string;
    sendreplies?: boolean;
    nsfw?: boolean;
    spoiler?: boolean;
    flairId?: string;
    flairText?: string;
};
export type SubmitPostOptions = (SubmitLinkOptions | SubmitSelfPostOptions | SubmitCustomPostOptions | SubmitMediaOptions) & {
    subredditName: string;
};
export type CrosspostOptions = CommonSubmitPostOptions & {
    subredditName: string;
    postId: string;
};
export type LinkFlair = {
    /**
     * One of: "text", "richtext"
     */
    type?: string;
    /**
     * Flair template ID to use when rendering this flair
     */
    templateId?: string;
    /**
     * Plain text representation of the flair
     */
    text?: string;
    /**
     * RichText object representation of the flair
     */
    richtext: {
        /**
         * Enum of element types.  e.g. emoji or text
         */
        elementType?: string;
        /**
         * Text to show up in the flair, e.g. "Need Advice"
         */
        text?: string;
        /**
         * Emoji references, e.g. ":rainbow:"
         */
        emojiRef?: string;
        /**
         * url string, e.g. "https://reddit.com/"
         */
        url?: string;
    }[];
    /**
     * Custom CSS classes from the subreddit's stylesheet to apply to the flair if rendered as HTML
     */
    cssClass?: string;
    /**
     * One of: "light", "dark"
     */
    textColor?: string;
    /**
     * Flair background color as a hex color string (# prefixed)
     * @example "#FF4500"
     */
    backgroundColor?: string;
};
/**
 * oEmbed is a format for allowing an embedded representation of a URL on third party sites.
 * The simple API allows a website to display embedded content (such as photos or videos)
 * when a user posts a link to that resource, without having to parse the resource directly.
 * See: https://oembed.com/
 */
export type OEmbed = {
    /** The resource type. Valid values, along with value-specific parameters, are described below. E.g. "video" */
    type: string;
    /** A text title, describing the resource. */
    title?: string | undefined;
    /** A URL for the author/owner of the resource. E.g. "YouTube" */
    providerName?: string | undefined;
    /** The name of the resource provider. E.g "https://www.youtube.com/" */
    providerUrl?: string | undefined;
    /** The oEmbed version number. This must be 1.0. */
    version: string;
    /** The width of the optional thumbnail in pixels */
    thumbnailWidth?: number;
    /** The height of the optional thumbnail in pixels */
    thumbnailHeight?: number;
    /** A URL to a thumbnail image representing the resource. */
    thumbnailUrl?: string | undefined;
    /** The HTML required to embed a video player. The HTML should have no padding or margins. Consumers may wish to load the HTML in an off-domain iframe to avoid XSS vulnerabilities. */
    html: string;
    /** The width in pixels required to display the HTML. */
    height?: number;
    /** The height in pixels required to display the HTML. */
    width?: number;
    /** A URL for the author/owner of the resource. E.g. "https://www.youtube.com/@Reddit" */
    authorUrl?: string | undefined;
    /** The name of the author/owner of the resource. E.g. "Reddit" */
    authorName?: string | undefined;
};
/**
 * Contains the data for a video hosted on Reddit that is in a post
 */
export type RedditVideo = {
    /** The bitrate of the video in kilobits per second. E.g. 450 */
    bitrateKbps?: number;
    /** The URL to the DASH playlist file. E.g. "https://v.redd.it/abc123/DASHPlaylist.mpd" */
    dashUrl?: string;
    /** The duration of the video in seconds. E.g. 30 */
    duration?: number;
    /** The direct URL to the video. E.g. "https://v.redd.it/abc123/DASH_1080.mp4?source=fallback" */
    fallbackUrl?: string;
    /** The height of the video in pixels. E.g. 1080 */
    height?: number;
    /** The URL to the HLS playlist file. E.g. "https://v.redd.it/abc123/HLSPlaylist.m3u8" */
    hlsUrl?: string;
    /** If `true`, the video is a GIF */
    isGif?: boolean;
    /** The URL to the scrubber media file. E.g. "https://v.redd.it/abc123/DASH_96.mp4" */
    scrubberMediaUrl?: string;
    /** The status of the transcoding process. E.g. "completed" */
    transcodingStatus?: string;
    /** The width of the video in pixels. E.g. 1920 */
    width?: number;
};
export type SecureMedia = {
    /** The type of the OEmbed media, if present (e.g. "youtube.com") */
    type?: string;
    oembed?: OEmbed;
    redditVideo?: RedditVideo;
};
export declare class Post {
    #private;
    get id(): T3ID;
    get authorId(): T2ID | undefined;
    get authorName(): string;
    get subredditId(): T5ID;
    get subredditName(): string;
    get permalink(): string;
    get title(): string;
    get body(): string | undefined;
    get bodyHtml(): string | undefined;
    get url(): string;
    get thumbnail(): {
        url: string;
        height: number;
        width: number;
    } | undefined;
    get createdAt(): Date;
    get score(): number;
    get numberOfComments(): number;
    get numberOfReports(): number;
    get approved(): boolean;
    get approvedAtUtc(): number;
    get bannedAtUtc(): number;
    get spam(): boolean;
    get stickied(): boolean;
    get removed(): boolean;
    /**
     * Who removed this object (username)
     */
    get removedBy(): string | undefined;
    /**
     * who/what removed this object. It will return one of the following:
     * - "anti_evil_ops": object is removed by a aeops member
     * - "author": object is removed by author of the post
     * - "automod_filtered": object is filtered by automod
     * - "community_ops": object is removed by a community team member
     * - "content_takedown": object is removed due to content violation
     * - "copyright_takedown": object is removed due to copyright violation
     * - "deleted": object is deleted
     * - "moderator": object is removed by a mod of the sub
     * - "reddit": object is removed by anyone else
     * - undefined: object is not removed
     */
    get removedByCategory(): string | undefined;
    get archived(): boolean;
    get edited(): boolean;
    get locked(): boolean;
    get nsfw(): boolean;
    get quarantined(): boolean;
    get spoiler(): boolean;
    get hidden(): boolean;
    get ignoringReports(): boolean;
    get distinguishedBy(): string | undefined;
    get comments(): Listing<Comment>;
    get flair(): LinkFlair | undefined;
    get secureMedia(): SecureMedia | undefined;
    get userReportReasons(): string[];
    get modReportReasons(): string[];
    toJSON(): Pick<Post, 'id' | 'authorId' | 'authorName' | 'subredditId' | 'subredditName' | 'permalink' | 'title' | 'body' | 'bodyHtml' | 'url' | 'thumbnail' | 'score' | 'numberOfComments' | 'numberOfReports' | 'createdAt' | 'approved' | 'spam' | 'stickied' | 'removed' | 'removedBy' | 'removedByCategory' | 'archived' | 'edited' | 'locked' | 'nsfw' | 'quarantined' | 'spoiler' | 'hidden' | 'ignoringReports' | 'distinguishedBy' | 'flair' | 'secureMedia' | 'userReportReasons' | 'modReportReasons'>;
    isApproved(): boolean;
    isSpam(): boolean;
    isStickied(): boolean;
    isRemoved(): boolean;
    isArchived(): boolean;
    isEdited(): boolean;
    isLocked(): boolean;
    isNsfw(): boolean;
    isQuarantined(): boolean;
    isSpoiler(): boolean;
    isHidden(): boolean;
    isIgnoringReports(): boolean;
    isDistinguishedBy(): string | undefined;
    edit(options: PostTextOptions): Promise<void>;
    /**
     * Set the suggested sort for comments on a Post.
     *
     * @throws {Error} Throws an error if the suggested sort could not be set.
     * @example
     * ```ts
     * const post = await reddit.getPostById(context.postId);
     * await post.setSuggestedCommentSort("NEW");
     * ```
     */
    setSuggestedCommentSort(suggestedSort: PostSuggestedCommentSort): Promise<void>;
    /**
     * Set a lightweight UI that shows while the custom post renders
     *
     * @param {JSX.ComponentFunction} ui - A JSX component function that returns a simple ui to be rendered.
     * @throws {Error} Throws an error if the preview could not be set.
     * @example
     * ```ts
     * const preview = (
     *   <vstack height="100%" width="100%" alignment="middle center">
     *     <text size="large">An updated preview!</text>
     *   </vstack>
     * );
     * const post = await reddit.getPostById(context.postId);
     * await post.setCustomPostPreview(() => preview);
     * ```
     */
    setCustomPostPreview(ui: JSX.ComponentFunction): Promise<void>;
    /**
     * Set a text fallback for the custom post
     *
     * @param {CustomPostTextFallbackOptions} options - A text or a richtext to render in a fallback
     * @throws {Error} Throws an error if the fallback could not be set.
     * @example
     * ```ts
     * // from a menu action, form, scheduler, trigger, custom post click event, etc
     * const newTextFallback = { text: 'This is an updated text fallback' };
     * const post = await context.reddit.getPostById(context.postId);
     * await post.setTextFallback(newTextFallback);
     * ```
     */
    setTextFallback(options: CustomPostTextFallbackOptions): Promise<void>;
    addComment(options: CommentSubmissionOptions): Promise<Comment>;
    delete(): Promise<void>;
    approve(): Promise<void>;
    remove(isSpam?: boolean): Promise<void>;
    lock(): Promise<void>;
    unlock(): Promise<void>;
    hide(): Promise<void>;
    unhide(): Promise<void>;
    markAsNsfw(): Promise<void>;
    unmarkAsNsfw(): Promise<void>;
    markAsSpoiler(): Promise<void>;
    unmarkAsSpoiler(): Promise<void>;
    sticky(position?: 1 | 2 | 3 | 4): Promise<void>;
    unsticky(): Promise<void>;
    distinguish(): Promise<void>;
    distinguishAsAdmin(): Promise<void>;
    undistinguish(): Promise<void>;
    ignoreReports(): Promise<void>;
    unignoreReports(): Promise<void>;
    getAuthor(): Promise<User | undefined>;
    crosspost(options: Omit<CrosspostOptions, 'postId'>): Promise<Post>;
    /**
     * Add a mod note for why the post was removed
     *
     * @param options.reasonId id of a Removal Reason - you can leave this as an empty string if you don't have one
     * @param options.modNote the reason for removal (maximum 100 characters) (optional)
     * @returns
     */
    addRemovalNote(options: {
        reasonId: string;
        modNote?: string;
    }): Promise<void>;
}
//# sourceMappingURL=Post.d.ts.map