/** * @fileoverview minimatch-fast - Drop-in replacement for minimatch * * This is the main entry point for the minimatch-fast package. It provides * a 100% API-compatible replacement for minimatch while using picomatch * internally for better performance and security. * * The package exports: * - minimatch(): Main function for testing if a path matches a pattern * - minimatch.match(): Filter an array of paths * - minimatch.filter(): Create a filter function for Array.filter() * - minimatch.makeRe(): Convert a pattern to a RegExp * - minimatch.braceExpand(): Expand brace patterns * - minimatch.escape(): Escape glob special characters * - minimatch.unescape(): Unescape glob special characters * - minimatch.defaults(): Create a new minimatch with default options * - Minimatch: Class for repeated matching against the same pattern * * @example * ```typescript * import minimatch from 'minimatch-fast'; * * // Basic matching * minimatch('bar.js', '*.js'); // true * minimatch('src/deep/file.ts', '**\/*.ts'); // true * * // Filter an array * minimatch.match(['a.js', 'b.txt'], '*.js'); // ['a.js'] * * // Create filter function * const jsFiles = files.filter(minimatch.filter('*.js')); * * // Use Minimatch class for repeated matching (more efficient) * const mm = new minimatch.Minimatch('**\/*.js'); * mm.match('src/index.js'); // true * ``` * * @author 686f6c61 * @see https://github.com/686f6c61/minimatch-fast * @license MIT */ import type { MinimatchOptions, MMRegExp, Platform, Sep, ParseReturn, ParseReturnFiltered, GlobstarSymbol } from './types.js'; import { GLOBSTAR } from './types.js'; import { Minimatch } from './minimatch-class.js'; export type { MinimatchOptions, MMRegExp, Platform, Sep, ParseReturn, ParseReturnFiltered, GlobstarSymbol, }; export { Minimatch, GLOBSTAR }; export { escape } from './escape.js'; export { unescape } from './unescape.js'; /** * Path separator for the current platform */ export declare const sep: Sep; export declare function minimatch(path: string, pattern: string, options?: MinimatchOptions): boolean; export declare namespace minimatch { var sep: Sep; var GLOBSTAR: typeof import("./types.js").GLOBSTAR; var Minimatch: typeof import("./minimatch-class.js").Minimatch; var filter: typeof import("./index.js").filter; var defaults: typeof import("./index.js").defaults; var braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; var makeRe: typeof import("./index.js").makeRe; var match: typeof import("./index.js").match; var escape: typeof import("./escape.js").escape; var unescape: typeof import("./unescape.js").unescape; var clearCache: typeof import("./cache.js").clearCache; var getCacheSize: typeof import("./cache.js").getCacheSize; } /** * Create a filter function for use with Array.filter() * * Uses cached Minimatch instance for better performance. * * @param pattern - The glob pattern * @param options - Matching options * @returns A function that tests paths against the pattern * * @example * ```typescript * const jsFilter = minimatch.filter('*.js'); * ['a.js', 'b.txt', 'c.js'].filter(jsFilter); // ['a.js', 'c.js'] * ``` */ export declare function filter(pattern: string, options?: MinimatchOptions): (path: string) => boolean; /** * Create a minimatch function with default options * * @param def - Default options to apply to all calls * @returns A new minimatch function with defaults applied * * @example * ```typescript * const mm = minimatch.defaults({ dot: true }); * mm('.hidden', '*'); // true (dot files included) * ``` */ export declare function defaults(def: MinimatchOptions): typeof minimatch; /** * Convert a glob pattern to a regular expression * * Uses cached Minimatch instance for better performance. * * @param pattern - The glob pattern * @param options - Matching options * @returns RegExp or false if pattern is invalid * * @example * ```typescript * const re = minimatch.makeRe('*.js'); * re.test('foo.js'); // true * ``` */ export declare function makeRe(pattern: string, options?: MinimatchOptions): false | MMRegExp; /** * Match a list of paths against a glob pattern * * Uses cached Minimatch instance for better performance. * * @param list - Array of paths to filter * @param pattern - The glob pattern * @param options - Matching options * @returns Array of matching paths * * @example * ```typescript * minimatch.match(['a.js', 'b.txt', 'c.js'], '*.js'); // ['a.js', 'c.js'] * ``` */ export declare function match(list: string[], pattern: string, options?: MinimatchOptions): string[]; export default minimatch; //# sourceMappingURL=index.d.ts.map