import { ContentReference } from '../domain';
import { PostBlobDataEntry } from './content-helpers';
import * as api from '../api';
import * as ub from '../urbit';
export type StyleInlineData = {
    type: 'style';
    style: 'bold' | 'italic' | 'strikethrough' | 'code';
    children: InlineData[];
};
export type TextInlineData = {
    type: 'text';
    text: string;
};
export type MentionInlineData = {
    type: 'mention';
    contactId: string;
};
export type GroupMentionInlineData = {
    type: 'groupMention';
    group: 'all' | string;
};
export type LineBreakInlineData = {
    type: 'lineBreak';
};
export type LinkInlineData = {
    type: 'link';
    href: string;
    text: string;
};
export type TaskInlineData = {
    type: 'task';
    checked: boolean;
    children: InlineData[];
};
export type InlineData = StyleInlineData | TextInlineData | MentionInlineData | GroupMentionInlineData | LineBreakInlineData | LinkInlineData | TaskInlineData;
export type InlineType = InlineData['type'];
export type InlineFromType<T extends InlineType> = Extract<InlineData, {
    type: T;
}>;
export type BlockquoteBlockData = {
    type: 'blockquote';
    content: InlineData[];
};
export type ParagraphBlockData = {
    type: 'paragraph';
    content: InlineData[];
};
export type BigEmojiBlockData = {
    type: 'bigEmoji';
    emoji: string;
};
export type ImageBlockData = {
    type: 'image';
    src: string;
    height: number;
    width: number;
    alt: string;
};
export type VideoBlockData = {
    type: 'video';
    src: string;
    height: number;
    width: number;
    alt: string;
};
export type FileUploadBlockData = {
    type: 'file';
    file: PostBlobDataEntry;
};
export type LinkBlockData = {
    type: 'link';
    url: string;
    title?: string;
    description?: string;
    siteName?: string;
    siteIconUrl?: string;
    previewImageUrl?: string;
    previewImageWidth?: string;
    previewImageHeight?: string;
};
export type ReferenceBlockData = ContentReference;
export type CodeBlockData = {
    type: 'code';
    content: string;
    lang?: string;
};
export type HeaderBlockData = {
    type: 'header';
    level: ub.HeaderLevel;
    children: InlineData[];
};
export type RuleBlockData = {
    type: 'rule';
};
export type ListBlockData = {
    type: 'list';
    list: ListData;
};
export type ListData = {
    content: InlineData[];
    type?: 'ordered' | 'unordered' | 'tasklist';
    children?: ListData[];
};
export type BlockData = BlockquoteBlockData | ParagraphBlockData | ImageBlockData | VideoBlockData | FileUploadBlockData | LinkBlockData | ReferenceBlockData | CodeBlockData | HeaderBlockData | RuleBlockData | ListBlockData | BigEmojiBlockData;
export type BlockType = BlockData['type'];
export type BlockFromType<T extends BlockType> = Extract<BlockData, {
    type: T;
}>;
export type PostContent = BlockData[];
export interface PlaintextPreviewConfig {
    blockSeparator: string;
    includeLinebreaks: boolean;
    includeRefTag: boolean;
    indentDepth?: number;
}
export declare namespace PlaintextPreviewConfig {
    const defaultConfig: PlaintextPreviewConfig;
    const inlineConfig: PlaintextPreviewConfig;
}
export declare function plaintextPreviewOf(content: PostContent, config?: PlaintextPreviewConfig): string;
export declare function plaintextPreviewOfInlineString(inlines: InlineData[], config: PlaintextPreviewConfig): string;
export declare function plaintextPreviewOfInline(inline: InlineData, config: PlaintextPreviewConfig): string;
/**
 * Preprocess content for rendering. Alterations include:
 * - Removing line breaks at end of content
 * - Identifying and extract block-like inlines to the top level (block quotes,
 *   code blocks, etc.)
 * - Simplifying data structure so that we can easily switch on type while
 *   rendering.
 *
 * I don't love that this happens each time a post is rendered -- I'd like to
 * move to something like this for all local content representation, only
 * converting it to the current format for interaction with the api.
 *
 * The format is very loosely inspired by ProseMirror's internal representation,
 * and could be converted to be compatible pretty easily.
 */
export declare function convertContent(input: unknown, blob: string | undefined | null): PostContent;
/**
 * Same as `convertContent`, but does not parse the input, and
 * applies more type strictness at callsite.
 */
export declare function convertContentSafe(story: Exclude<api.PostContent, null>): PostContent;
export declare function prependInline(content: BlockData[], inline: InlineData): BlockData[];
export declare function appendInline(content: BlockData[], inline: InlineData): BlockData[];
export declare function getTextContent(postContent: Exclude<api.PostContent, null>, config?: PlaintextPreviewConfig): string;
export declare function getTextContent(postContent: api.PostContent, config?: PlaintextPreviewConfig): string | null;
//# sourceMappingURL=postContent.d.ts.map