import { LifecycleHooks } from '@b64hub/sfpm-core'; import type { ScriptHooksOptions } from './types.js'; /** * Creates lifecycle hooks for running custom scripts during installation. * * Registers hooks on `install:pre` and `install:post` that execute * user-defined scripts. Supports shell scripts (`.sh`), TypeScript * (`.ts`), JavaScript (`.js`), anonymous Apex (`.apex`), and npm * scripts from `package.json`. * * Scripts are resolved from **two sources** (merged): * * 1. **Global options** — `scriptHooks({ scripts: [...] })` in `sfpm.config.ts` * 2. **Per-package overrides** — `packageOptions.hooks["scripts"].pre/post` * * Per-package scripts are appended after global scripts at each timing. * When a per-package `hooks["scripts"]` is set to `false`, the hook is * skipped entirely for that package (handled by the lifecycle engine). * * @param options - Hook configuration options * @returns A LifecycleHooks instance to pass to `defineConfig({ hooks: [...] })` * * @example * ```typescript * // sfpm.config.ts * import { defineConfig } from '@b64hub/sfpm-core'; * import { scriptHooks } from '@b64hub/sfpm-hooks'; * * export default defineConfig({ * hooks: [ * scriptHooks({ * scripts: [ * { path: 'scripts/pre-deploy.sh', timing: 'pre' }, * { path: 'scripts/seed-data.ts', timing: 'post' }, * { path: 'scripts/activate.apex', timing: 'post' }, * { path: 'seed-data', type: 'npm', timing: 'post' }, * ], * }), * ], * }); * ``` */ export declare function scriptHooks(options: ScriptHooksOptions): LifecycleHooks;