import type { HookParameters } from 'astro';
import type { PluginOption } from 'vite';
export type Hooks = Required<Astro.IntegrationHooks>;
/**
 * Allows resolving paths relatively to the integration folder easily. Call it like this:
 *
 * @param {string} _base - The location you want to create relative references from. `import.meta.url` is usually what you'll want.
 *
 * @see https://astro-integration-kit.netlify.app/core/create-resolver/
 *
 * @example
 * ```ts
 * const { resolve } = createResolver(import.meta.url);
 * const pluginPath = resolve("./plugin.ts");
 * ```
 *
 * This way, you do not have to add your plugin to your package.json `exports`.
 */
export declare const createResolver: (_base: string) => {
    resolve: (...path: Array<string>) => string;
};
/**
 * A utility to be used on an Astro hook.
 *
 * @see defineUtility
 */
export type HookUtility<THook extends keyof Hooks, TArgs extends Array<any>, TReturn> = (params: HookParameters<THook>, ...args: TArgs) => TReturn;
/**
 * Allows defining a type-safe function requiring all the params of a given hook.
 * It uses currying to make TypeScript happy.
 *
 * @param {string} _hook
 *
 * @see https://astro-integration-kit.netlify.app/core/define-utility/
 *
 * @example
 * ```ts
 * const test = defineUtility("astro:config:setup")((params, foo: boolean) => {
 *  return "bar";
 * });
 * ```
 */
export declare const defineUtility: <THook extends keyof Hooks>(_hook: THook) => <TArgs extends Array<any>, T>(fn: HookUtility<THook, TArgs, T>) => HookUtility<THook, TArgs, T>;
/**
 * Checks for the existence of a Vite plugin inside the Astro config.
 *
 * @param {import("astro").HookParameters<"astro:config:setup">} params
 * @param {Params} options
 * @param {string | import("vite").PluginOption} options.plugin
 *
 * @see https://astro-integration-kit.netlify.app/utilities/has-vite-plugin/
 *
 * @example
 * ```ts
 * hasVitePlugin(params, {
 * 		plugin: "vite-plugin-my-integration",
 * })
 * ```
 */
export declare const hasVitePlugin: HookUtility<"astro:config:setup", [{
    plugin: string | PluginOption;
}], boolean>;
/**
 * Adds a [vite plugin](https://vitejs.dev/guide/using-plugins) to the
 * Astro config.
 *
 * @param {import("astro").HookParameters<"astro:config:setup">} params
 * @param {object} options
 * @param {import("vite").PluginOption} options.plugin
 * @param {boolean} [options.warnDuplicated=true]
 *
 * @see https://astro-integration-kit.netlify.app/utilities/add-vite-plugin/
 *
 * @example
 * ```ts
 * addVitePlugin(params, {
 * 		plugin,
 * 		warnDuplicated: true,
 * })
 * ```
 */
export declare const addVitePlugin: HookUtility<"astro:config:setup", [{
    plugin: PluginOption;
    warnDuplicated?: boolean;
}], void>;
type VirtualImport = {
    id: string;
    content: string;
    context?: 'server' | 'client' | undefined;
};
type Imports = Record<string, string> | Array<VirtualImport>;
/**
 * Creates a Vite virtual module and updates the Astro config.
 * Virtual imports are useful for passing things like config options, or data computed within the integration.
 *
 * @param {import("astro").HookParameters<"astro:config:setup">} params
 * @param {object} options
 * @param {string} options.name
 * @param {Imports} options.imports
 *
 * @see https://astro-integration-kit.netlify.app/utilities/add-virtual-imports/
 *
 * @example
 * ```ts
 * // my-integration/index.ts
 * import { addVirtualImports } from "astro-integration-kit";
 *
 * addVirtualImports(params, {
 * 		name: 'my-integration',
 * 		imports: {
 * 			'virtual:my-integration/config': `export default ${ JSON.stringify({foo: "bar"}) }`,
 * 		},
 *	});
 * ```
 *
 * This is then readable anywhere else in your integration:
 *
 * ```ts
 * // myIntegration/src/component/layout.astro
 * import config from "virtual:my-integration/config";
 *
 * console.log(config.foo) // "bar"
 * ```
 */
export declare const addVirtualImports: HookUtility<"astro:config:setup", [{
    name: string;
    imports: Imports;
    __enableCorePowerDoNotUseOrYouWillBeFired?: boolean;
}], void>;
export {};
