/** * Modyo module types that can have content offloaded */ export type ModyoModule = "channels" | "content" | "global"; /** * Categories for Channels module content */ export type ChannelsCategory = "widgets" | "snippets" | "layouts" | "stylesheets" | "javascripts" | "navigation"; /** * Categories for Content module content */ export type ContentCategory = "types" | "entries"; /** * All possible content categories */ export type ContentOffloadCategory = ChannelsCategory | ContentCategory; /** * Options for offloading content to filesystem */ export interface OffloadOptions { /** Modyo module (channels, content, global) */ module: ModyoModule; /** Context slug (siteSlug for channels, spaceSlug for content, empty for global) */ contextSlug?: string; /** Content category (widgets, snippets, layouts, etc.) */ category: ContentOffloadCategory; /** Resource name (widget/template/type name - will be slugified) */ name: string; /** Subfile identifier for nested content (e.g., 'html', 'css', 'js' for widgets) */ subfile?: string; /** File extension override (default based on category) */ extension?: string; /** Base path for writing files (defaults to process.cwd()) */ basePath?: string | undefined; } /** * Result of offloading content to filesystem */ export interface OffloadResult { /** Absolute path to the written file */ path: string; /** Relative path from project root (for response) */ relativePath: string; /** Number of bytes written */ size: number; } /** * Get the base output directory for offloaded content * @returns Absolute path to the .modyo-mcp directory */ export declare function getOutputBaseDir(): string; /** * Build the output path for offloaded content * @param options - Offload options * @returns Relative path from project root */ export declare function buildOutputPath(options: OffloadOptions): string; /** * Offload content to the filesystem * * Writes content to an organized folder structure: * .modyo-mcp/{module}/{contextSlug}/{category}/{name}/... * * @param content - The content to write (string) * @param options - Offload options specifying location * @returns Result with paths and size * * @example * // Offload a widget's HTML * await offloadContent(widgetHtml, { * module: 'channels', * contextSlug: 'my-site', * category: 'widgets', * name: 'Hero Banner', * subfile: 'html' * }); * // Writes to: .modyo-mcp/channels/my-site/widgets/hero-banner/html.liquid * * @example * // Offload a snippet * await offloadContent(snippetBody, { * module: 'channels', * contextSlug: 'my-site', * category: 'snippets', * name: 'header' * }); * // Writes to: .modyo-mcp/channels/my-site/snippets/header.liquid */ export declare function offloadContent(content: string, options: OffloadOptions): Promise; /** * Offload widget code (html, css, js) to filesystem * * Convenience function for offloading all three widget files at once. * Uses parallel I/O for better performance. * * @param widget - Object containing html, css, js content * @param options - Base offload options (without subfile) * @returns Object with paths for each file type */ export declare function offloadWidgetCode(widget: { html?: string; css?: string; js?: string; }, options: Omit): Promise<{ html?: string; css?: string; js?: string; }>; //# sourceMappingURL=contentOffloadHelper.d.ts.map