import { PinionContext, Callable } from '../core.js'; export type Location = (lines: string[], ctx: C, fileName: string) => Promise<{ index: number; pattern?: string | RegExp | undefined; }>; /** * Inject a template into a file at a specific location. All locations are line based. * * @param template The content to inject * @param location The location where to inject. Can be one of `before()`, `after()`, `prepend()` or `append()` * @param target The target file to inject to * @returns The current context */ export declare const inject: (template: Callable, location: Location, target: Callable) => (ctx: C) => Promise; /** * Inject before a line matching the given pattern. * * @param pattern The pattern to inject before * @returns The location used by the `inject` task */ export declare const before: (pattern: Callable) => (lines: string[], ctx: C, fileName: string) => Promise<{ index: number; pattern: string | RegExp; }>; /** * Inject after a line matching a given pattern. * * @param pattern The pattern to inject after * @returns The location used by the `inject` task */ export declare const after: (pattern: Callable) => (lines: string[], ctx: C, fileName: string) => Promise<{ index: number; pattern: string | RegExp; }>; /** * Inject at the beginning of a file. * * @returns The location used by the `inject` task */ export declare const prepend: () => () => Promise<{ index: number; }>; /** * Append at the end of a file. * * @returns The location used by the `inject` task. */ export declare const append: () => (lines: string[]) => Promise<{ index: number; }>;