import type { ConfiguredPolicy, PolicyDefinition, PolicyInstance, PolicyInstanceSettings, PolicyShape } from "./policy.js"; /** * Options for configuring a policy instance. * * @alpha */ export interface PolicyOptions { /** * File paths matching these patterns will be excluded from this policy. * Patterns are matched against repo-relative paths. */ exclude?: (string | RegExp)[]; } /** * Configure a policy for use in repopo. * * @remarks * This function takes a policy definition and returns a configured policy instance * that can be added to the `policies` array in `repopo.config.ts`. * * Handlers are automatically normalized: async functions are wrapped for Effection * compatibility, while generator functions are used directly. * * @example * ```typescript * // Policy with no config, just options * policy(NoJsFileExtensions, { exclude: ["bin/*"] }) * * // Policy with config * policy(PackageJsonProperties, { verbatim: { license: "MIT" } }) * * // Policy with config and options * policy(PackageJsonProperties, { verbatim: { license: "MIT" } }, { exclude: ["vendor/*"] }) * ``` * * @alpha */ export declare function policy(policyDef: PolicyShape, options?: PolicyOptions): ConfiguredPolicy; /** @alpha */ export declare function policy(policyDef: PolicyShape, config: C, options?: PolicyOptions): ConfiguredPolicy; /** * Input arguments for creating a policy definition. * * @deprecated Use {@link PolicyShape} directly instead. * * @alpha */ export type PolicyDefinitionInput = PolicyDefinition; /** * Creates a {@link PolicyDefinition} from the provided arguments. * * @deprecated Define policies as object literals satisfying {@link PolicyShape} instead. * * @example * ```typescript * const MyPolicy = makePolicyDefinition({ * name: "MyPolicy", * description: "Ensures files follow conventions", * match: /\.ts$/, * handler: async ({ file }) => true, * }); * ``` * * @alpha */ export declare function makePolicyDefinition(args: PolicyDefinitionInput): PolicyDefinition; /** * Combine a {@link PolicyDefinition} with a policy-specific config and other settings. * * @deprecated Use the `policy` function instead, which has a simpler API. * * @example * ```typescript * makePolicy(NoJsFileExtensions, undefined, { excludeFiles: ["bin/*"] }) * ``` * * @alpha */ export declare function makePolicy(definition: PolicyDefinition, config?: C, settings?: PolicyInstanceSettings): PolicyInstance; //# sourceMappingURL=makePolicy.d.ts.map