import { HookUtility } from '../core/define-utility.js'; import 'astro'; import '../core/types.js'; import '../internal/types.js'; type HasIntegrationParams = ({ position?: undefined; relativeTo?: string; } | { position: "before" | "after"; relativeTo: string; }) & { name: string; }; /** * Checks whether an integration is already installed. * * If `before` is given, returns true only if the integration is installed before the named|provided integration. * If `after` is given, returns true only if the integration is installed after the named|provided integration. * * @param {import("astro").HookParameters<"astro:config:setup">} params * @param {object} options * @param {string} options.name - Integration to look up. * @param {undefined | "before" | "after"} options.position - Position in relation to another integration to check. * @param {undefined | string} options.relativeTo - Other integration to check for relative poisition. * * @returns {boolean} * * @throws {AstroError} When `params.position` is defined but `params.relativeTo` isn't. * * @see https://astro-integration-kit.netlify.app/utilities/has-integration/ * * @example * ```ts * hasIntegration(params, { * name: "@astrojs/tailwind", * }) * ``` */ declare const hasIntegration: HookUtility<"astro:config:setup", [HasIntegrationParams], boolean>; export { hasIntegration };