import MarkdownIt from 'markdown-it';
export interface ServerModules {
    tiptapToMarkdown: (doc: any, title: string, metadata?: Record<string, any>) => string;
    getDocument: () => any;
    getTitle: () => string;
    getMetadata: () => Record<string, any>;
    getActiveProfile: () => string;
    getDataDir: () => string;
    getDocId: () => string;
    platformFetch: (path: string, options?: RequestInit) => Promise<Response>;
}
export declare function getServerModules(): Promise<ServerModules>;
export interface PluginConfigField {
    type: 'string' | 'number' | 'boolean';
    required?: boolean;
    env?: string;
    description?: string;
}
export interface PluginMcpTool {
    name: string;
    description: string;
    inputSchema: Record<string, unknown>;
    handler: (params: Record<string, unknown>) => Promise<unknown>;
}
export interface PluginRouteContext {
    app: import('express').Router;
    config: Record<string, string>;
    dataDir: string;
}
export interface PluginSidebarMenuItem {
    label: string;
    action: string;
    promptForFocus?: boolean;
}
export interface OpenWriterPlugin {
    name: string;
    version: string;
    description?: string;
    category?: 'writing' | 'social-media' | 'image-generation' | 'publishing' | 'productivity' | 'analytics';
    configSchema?: Record<string, PluginConfigField>;
    registerRoutes?(ctx: PluginRouteContext): void | Promise<void>;
    mcpTools?(config: Record<string, string>): PluginMcpTool[];
    sidebarMenuItems?(): PluginSidebarMenuItem[];
}
export declare const md: MarkdownIt;
/** Strip YAML frontmatter and TipTap empty markers from markdown output */
export declare function stripFrontmatter(markdown: string): string;
/** Scan HTML for /_images/ references, read local files, return base64 array for R2 upload */
export declare function extractLocalImages(html: string): Promise<Array<{
    path: string;
    data: string;
    content_type: string;
}>>;
/** Convert current document's TipTap JSON to body HTML + plain text */
export declare function documentToEmail(): Promise<{
    html: string;
    text: string;
    subject: string;
    json: any;
}>;
/** Strip markdown syntax to produce clean plain text for email */
export declare function markdownToPlainText(markdown: string): string;
/** Strip inline markdown marks from a string */
export declare function stripInline(text: string): string;
/** Make an authenticated request to the Publish API via platform proxy */
export declare function publishFetch(_config: Record<string, string>, path: string, options?: RequestInit): Promise<Response>;
