@types/fs-finder
TypeScript icon, indicating that this package has built-in type declarations

1.8.33 • Public • Published

Installation

npm install --save @types/fs-finder

Summary

This package contains type definitions for fs-finder (https://github.com/sakren/node-fs-finder).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-finder.

index.d.ts

declare namespace FsFinder {
    type AsyncFunction = (paths: string | string[]) => void;
    type Type = string; // 'all'|'directories'|'files'
    type Mask = string;
    type Directory = string;

    export class Finder extends Base {
        static TIME_FORMAT: string;
        static in(path: string): Finder;
        static from(path: string): Finder;
        static find(path: string, fn?: AsyncFunction, type?: Type): Finder;
        static findFiles(path?: string, fn?: AsyncFunction): Finder;
        static findDirectories(path?: string, fn?: AsyncFunction): Finder;
        static findFile(path?: string, fn?: AsyncFunction): Finder;
        static findDirectory(path?: string, fn?: AsyncFunction): Finder;
        find(mask?: Mask, fn?: AsyncFunction, type?: Type): string[];
        findFiles(mask?: Mask, fn?: AsyncFunction): string[];
        findDirectories(mask?: Mask, fn?: AsyncFunction): string[];
        findFile(mask?: Mask, fn?: AsyncFunction): string[];
        findDirectory(mask?: Mask, fn?: AsyncFunction): string[];
        size(operation?: any, value?: any): Finder;
        date(operation?: any, value?: any): Finder;
    }

    export class Base {
        recursively(recursive?: boolean): Finder;
        exclude(excludes: string | string[], exactly?: boolean): Finder;
        showSystemFiles(systemFiles?: boolean): Finder;
        lookUp(up?: boolean): Finder;
        findFirst(findFirst?: boolean): Finder;
        filter(fn: Function): Finder;

        getPathsSync(type?: Type, mask?: Mask, dir?: Directory): string[];
        getPathsAsync(fn: AsyncFunction, type?: Type, mask?: Mask, dir?: Directory): void;

        checkExcludes(path: string): boolean;
        checkSystemFiles(path: string): boolean;
        checkFilters(path: string, stats: any): boolean;
        checkFile(path: string, stats: any, mask: Mask, type: Type): number;

        getPathsFromParentsSync(mask?: Mask, type?: Type): string[];
        getPathsFromParentsAsync(fn: AsyncFunction, mask?: Mask, type?: Type): void;
    }
}

import Finder = FsFinder.Finder;
export = Finder;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Michael Zabka.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/fs-finder

Weekly Downloads

62

Version

1.8.33

License

MIT

Unpacked Size

6.73 kB

Total Files

5

Last publish

Collaborators

  • types