import type { ParsedDoc, NavItem, ResolvedHierarchy, DocSource } from './types.js'; type RemoteFolder = { id: string; name: string; slug: string; icon?: string; is_default?: boolean; display_order?: number; }; type RemoteCategory = { id: string; name: string; icon?: string; description?: string; folder_id?: string; parent_category_id?: string; display_order?: number; slug?: string; }; export declare class GatelyAPI { private readonly baseUrl; private readonly apiKey; private projectId?; constructor(baseUrl: string, apiKey: string); /** * Auto-detect project ID from API key via /api/cli/whoami. * Caches the result after first call. */ getProjectId(): Promise; private request; private foldersCache; listFolders(): Promise; createFolder(item: NavItem): Promise; updateFolder(id: string, item: Partial): Promise; /** * Resolve a folder by name — create if missing, update fields if changed. * Returns the folder ID. */ resolveFolder(raw: string | NavItem): Promise; private categoriesCache; listCategories(): Promise; private invalidateCategoriesCache; createCategory(item: NavItem, folderId?: string, parentCategoryId?: string): Promise; updateCategory(id: string, item: Partial, folderId?: string, parentCategoryId?: string): Promise; /** * Resolve the full Folder → Category → Subcategory hierarchy for a doc source. * Creates missing items, updates icons if changed. * Uses a per-push cache that is invalidated after any creation to avoid stale lookups. */ resolveHierarchy(source: DocSource): Promise; listArticles(): Promise>; getArticle(articleId: string): Promise; createArticle(doc: ParsedDoc, categoryId?: string): Promise<{ id: string; slug: string; }>; updateArticle(id: string, doc: ParsedDoc, categoryId?: string): Promise; uploadOpenApi(specContent: string, filename: string): Promise; syncDoc(doc: ParsedDoc, existing: Array<{ id: string; slug: string; }>, categoryId?: string): Promise<{ action: 'created' | 'updated'; articleId: string; title: string; slug: string; }>; deleteCategory(id: string): Promise; /** * Clean up categories that are no longer referenced in the config. * Only deletes categories with no articles. */ cleanupUnusedCategories(usedCategoryNames: Set): Promise; deleteArticle(id: string): Promise; uncategorizeArticle(id: string): Promise; deleteArticlesBySlugs(slugs: string[]): Promise<{ deleted: string[]; notFound: string[]; }>; uncategorizeArticlesBySlugs(slugs: string[]): Promise<{ uncategorized: string[]; notFound: string[]; }>; } export {};