import { LifecycleHooks } from '@b64hub/sfpm-core'; import type { ProfileHooksOptions } from './types.js'; /** * Creates lifecycle hooks for profile cleaning and scoping. * * Registers a hook on `install:pre` that cleans profile XML files * before deployment. This removes permissions that reference metadata not * present in the allowed scope, preventing deployment failures. * * The scoping logic is migrated from * {@link https://github.com/flxbl-io/sfprofiles | sfprofiles} and adapted * to work as a standalone cleaner. When `scope` is `'org'` and a * `context.orgConnection` is present, the hook also queries the target org * for standard metadata — preserving permissions that reference components * not in the package source but present in the org. * * @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 { profileHooks } from '@b64hub/sfpm-hooks'; * * export default defineConfig({ * hooks: [ * profileHooks({ scope: 'source', removeLoginIpRanges: true }), * ], * }); * ``` */ export declare function profileHooks(options?: ProfileHooksOptions): LifecycleHooks;