import { UnionToIntersection } from '../utils';

type Flag = string;
type Nest = string;
export type JSONContent = {
    type?: string;
    attrs?: Record<string, any>;
    content?: JSONContent[];
    marks?: {
        type: string;
        attrs?: Record<string, any>;
        [key: string]: any;
    }[];
    text?: string;
    [key: string]: any;
};
export interface Ship {
    ship: string;
}
export interface Sect {
    sect: string | null;
}
export interface Italics {
    italics: Inline[];
}
export interface Bold {
    bold: Inline[];
}
export interface Strikethrough {
    strike: Inline[];
}
export interface Break {
    break: null;
}
export interface InlineCode {
    'inline-code': string;
}
export interface BlockCode {
    code: string;
}
export interface Blockquote {
    blockquote: Inline[];
}
/**
 A reference to the accompanying blocks, indexed at 0
*/
export interface BlockReference {
    block: {
        index: number;
        text: string;
    };
}
export interface Tag {
    tag: string;
}
export interface Link {
    link: {
        href: string;
        content: string;
    };
}
export interface Task {
    task: {
        checked: boolean;
        content: Inline[];
    };
}
export type Inline = string | Bold | Italics | Strikethrough | Ship | Sect | Break | InlineCode | BlockCode | Blockquote | BlockReference | Tag | Link | Task;
export type InlineKey = 'italics' | 'bold' | 'strike' | 'blockquote' | 'inline-code' | 'block' | 'code' | 'tag' | 'link' | 'break' | 'ship' | 'task' | 'sect';
export declare function isInline(c: Inline | Block): c is Inline;
export interface ChanCite {
    chan: {
        nest: Nest;
        where: string;
    };
}
export interface GroupCite {
    group: Flag;
}
export interface DeskCite {
    desk: {
        flag: string;
        where: string;
    };
}
export interface BaitCite {
    bait: {
        group: Flag;
        graph: Flag;
        where: string;
    };
}
export type Cite = ChanCite | GroupCite | DeskCite | BaitCite;
export interface Image {
    image: {
        src: string;
        height: number;
        width: number;
        alt: string;
    };
}
export interface LinkBlock {
    link: {
        url: string;
        meta: Record<string, string | undefined> & {
            title?: string;
            description?: string;
            author?: string;
            siteName?: string;
            siteIcon?: string;
            previewImageUrl?: string;
            previewImageHeight?: string;
            previewImageWidth?: string;
        };
    };
}
export type ListType = 'ordered' | 'unordered' | 'tasklist';
export interface List {
    list: {
        type: 'ordered' | 'unordered' | 'tasklist';
        items: Listing[];
        contents: Inline[];
    };
}
export type ListItem = {
    item: Inline[];
};
export type Listing = List | ListItem;
export interface ListingBlock {
    listing: Listing;
}
export type HeaderLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
export interface Header {
    header: {
        tag: HeaderLevel;
        content: Inline[];
    };
}
export interface Rule {
    rule: null;
}
export interface Code {
    code: {
        code: string;
        lang: string;
    };
}
export type Block = Image | {
    cite: Cite;
} | ListingBlock | Header | Rule | Code | LinkBlock;
export declare namespace Block {
    function is<K extends keyof UnionToIntersection<Block>>(poly: Block, type: K): poly is Pick<UnionToIntersection<Block>, K>;
}
export declare function isBlock(c: Inline | Block): c is Block;
export declare function isBold(item: unknown): item is Bold;
export declare function isItalics(item: unknown): item is Italics;
export declare function isLink(item: unknown): item is Link;
export declare function isStrikethrough(item: unknown): item is Strikethrough;
export declare function isBlockquote(item: unknown): item is Blockquote;
export declare function isInlineCode(item: unknown): item is InlineCode;
export declare function isBlockCode(item: unknown): item is BlockCode;
export declare function isBreak(item: unknown): item is Break;
export declare function isShip(item: unknown): item is Ship;
export declare function isSect(item: unknown): item is Sect;
export declare function isHeader(block: Block): block is Header;
export declare function isCode(item: unknown): item is Code;
export declare function isListing(block: Block): block is ListingBlock;
export declare function isListItem(listing: Listing): listing is ListItem;
export declare function isList(listing: Listing): listing is List;
export declare function isTag(item: unknown): item is Tag;
export declare function isBlockReference(item: unknown): item is BlockReference;
export declare function isTask(item: unknown): item is Task;
export declare function isImage(item: unknown): item is Image;
export declare function isBlockLink(item: unknown): item is LinkBlock;
export declare function isCite(s: Block): boolean;
export {};
//# sourceMappingURL=content.d.ts.map