import type { ToolkitOptions, ToolkitResult, VerifyResult } from "./lib/types.js"; export type { DryRunResult, FileChange, ManifestEntry, ToolkitManifest, ToolkitOptions, ToolkitResult, VerifyResult, } from "./lib/types.js"; export { computeChanges, getInstalledVersion, hashFile, isToolkitInstalled, loadManifest, walkDir, } from "./lib/updater.js"; /** Options for createExtension via API */ export interface CreateApiOptions extends ToolkitOptions { name: string; signal?: AbortSignal; onUpdate?: (msg: string) => void; } /** Options for retrofitExtension via API */ export interface RetrofitApiOptions extends ToolkitOptions { signal?: AbortSignal; onUpdate?: (msg: string) => void; } /** * Create a new Pi extension or safely update an existing one. * * If the target already has toolkit files (detected via `.pi-extension-toolkit-manifest.json`), * uses safe update logic to preserve user modifications. User-modified files are skipped * unless `force: true` is set, in which case they show as conflicts. * * @param options - Creation options including name, targetDir, and control flags * @returns Structured result with file lists and conflict info * * @example * ```typescript * import { createExtensionApi } from 'pi-extension-toolkit/api'; * * // New project * const result = await createExtensionApi({ name: 'pi-my-tool', targetDir: './my-tool' }); * console.log(`Created ${result.filesCreated.length} files`); * * // Safe update (dry-run first) * const preview = await createExtensionApi({ name: 'pi-my-tool', targetDir: './my-tool', dryRun: true }); * ``` */ export declare function createExtensionApi(options: CreateApiOptions): Promise; /** * Retrofit an existing Pi extension to current template standards. * * Uses safe update logic: if the target has a toolkit manifest, only applies * patches that haven't been user-modified. Reports conflicts for files that * can't be safely updated. * * @param options - Retrofit options including targetDir and control flags * @returns Structured result with change lists * * @example * ```typescript * import { retrofitApi } from 'pi-extension-toolkit/api'; * * // Preview first * const preview = await retrofitApi({ targetDir: './my-legacy-extension', dryRun: true }); * * // Apply * const result = await retrofitApi({ targetDir: './my-legacy-extension' }); * ``` */ export declare function retrofitApi(options: RetrofitApiOptions): Promise; /** * Verify a Pi extension against template standards. * * @param targetDir - Directory of the extension to verify * @returns Structured result with pass/fail status and issue list * * @example * ```typescript * import { verifyApi } from 'pi-extension-toolkit/api'; * const result = await verifyApi('./my-extension'); * if (result.passed) { * console.log('All checks passed!'); * } else { * for (const issue of result.issues) console.warn(issue); * } * ``` */ export declare function verifyApi(targetDir: string): Promise; /** * Check an extension and return a human-friendly status. * * @param targetDir - Directory to check * @returns Status object with installed version info */ export declare function checkStatus(targetDir: string): Promise<{ installed: boolean; version: string | null; hasConflicts: boolean; lastOperation: "create" | "retrofit" | null; }>;