import type { Subprocess } from 'bun'; export type { Subprocess }; /** * Get the path to the tinker history file. */ export declare function getHistoryPath(config?: TinkerConfig): string; /** * Read history entries from file. */ export declare function readHistory(config?: TinkerConfig): string[]; /** * Append a single entry to the history file. * * The history file lives at `~/.stacks_tinker_history` and accumulates * every expression a developer types — including any one-off pasted * tokens, API keys, or DB credentials. Forcing 0600 permissions keeps * the file readable only by the file's owner so other users on a shared * machine can't grep it for accidentally-committed secrets. */ export declare function appendHistory(entry: string, config?: TinkerConfig): void; /** * Clear the tinker history file. */ export declare function clearHistory(config?: TinkerConfig): void; /** * Start an interactive Stacks tinker session. * * Launches Bun's built-in REPL with all Stacks framework modules * preloaded into the global scope. ORM models, database, config, * logging, and other framework utilities are immediately available. * * @example * ```ts * import { startTinker } from '@stacksjs/tinker' * * await startTinker() * ``` * * @example * ```ts * // Evaluate a single expression * await startTinker({ eval: 'await User.count()' }) * ``` * * @example * ```ts * // Evaluate and print * await startTinker({ print: 'await User.all()' }) * ``` */ export declare function startTinker(config?: TinkerConfig): Promise<{ exitCode: number }>; /** * Convenience function to evaluate a single expression in tinker context * and return the result. */ export declare function tinkerEval(expression: string, config?: TinkerConfig): Promise<{ exitCode: number }>; /** * Convenience function to evaluate and print a single expression. */ export declare function tinkerPrint(expression: string, config?: TinkerConfig): Promise<{ exitCode: number }>; export declare interface TinkerConfig { preload?: string[] historyFile?: string historySize?: number cwd?: string banner?: boolean stacksPreload?: boolean eval?: string print?: string verbose?: boolean }