@file-services/types
Advanced tools
Comparing version 0.4.9 to 0.4.10
@@ -32,2 +32,8 @@ import { IBaseFileSystemAsync, IBaseFileSystemSync, IFileSystemStats } from './base-api'; | ||
/** | ||
* Search for files inside `rootDirectory`. | ||
* | ||
* @returns absolute paths of all found files. | ||
*/ | ||
findFilesSync(rootDirectory: string, options?: IWalkOptions): string[]; | ||
/** | ||
* Search for a specific file name in parent directory chain. | ||
@@ -81,2 +87,8 @@ * Useful for finding configuration or manifest files. | ||
/** | ||
* Search for files inside `rootDirectory`. | ||
* | ||
* @returns absolute paths of all found files. | ||
*/ | ||
findFiles(rootDirectory: string, options?: IWalkOptions): Promise<string[]>; | ||
/** | ||
* Search for a specific file name in parent directory chain. | ||
@@ -127,13 +139,17 @@ * Useful for finding configuration or manifest files. | ||
} | ||
/** | ||
* Walk method options | ||
*/ | ||
export interface IWalkOptions { | ||
/** | ||
* Optional filter function that receives a descriptor and returns | ||
* Optional file filtering function that receives a file descriptor and returns | ||
* whether it should be included in the result. | ||
* | ||
* Returning `false` for directories causes the walker to not read their children. | ||
* @default true returned for all files. | ||
*/ | ||
filter?(pathDesc: IFileSystemDescriptor): boolean; | ||
filterFile?(pathDesc: IFileSystemDescriptor): boolean; | ||
/** | ||
* Optional directory filtering function that receives a directory descriptor and returns | ||
* whether it should be walked into. | ||
* | ||
* @default true returned for all directories. | ||
*/ | ||
filterDirectory?(pathDesc: IFileSystemDescriptor): boolean; | ||
} | ||
@@ -140,0 +156,0 @@ export interface IDirectoryContents { |
{ | ||
"name": "@file-services/types", | ||
"description": "Common file system interfaces", | ||
"version": "0.4.9", | ||
"version": "0.4.10", | ||
"main": "cjs/index.js", | ||
@@ -25,3 +25,3 @@ "types": "cjs/index.d.ts", | ||
"sideEffects": false, | ||
"gitHead": "822c37fa3606df3f2bca380d9968c97a3e18ebcf" | ||
"gitHead": "2c80218e713807c3ec965708c78e14af3433bcba" | ||
} |
@@ -36,2 +36,9 @@ import { IBaseFileSystemAsync, IBaseFileSystemSync, IFileSystemStats } from './base-api' | ||
/** | ||
* Search for files inside `rootDirectory`. | ||
* | ||
* @returns absolute paths of all found files. | ||
*/ | ||
findFilesSync(rootDirectory: string, options?: IWalkOptions): string[] | ||
/** | ||
* Search for a specific file name in parent directory chain. | ||
@@ -97,2 +104,9 @@ * Useful for finding configuration or manifest files. | ||
/** | ||
* Search for files inside `rootDirectory`. | ||
* | ||
* @returns absolute paths of all found files. | ||
*/ | ||
findFiles(rootDirectory: string, options?: IWalkOptions): Promise<string[]> | ||
/** | ||
* Search for a specific file name in parent directory chain. | ||
@@ -155,13 +169,18 @@ * Useful for finding configuration or manifest files. | ||
/** | ||
* Walk method options | ||
*/ | ||
export interface IWalkOptions { | ||
/** | ||
* Optional filter function that receives a descriptor and returns | ||
* Optional file filtering function that receives a file descriptor and returns | ||
* whether it should be included in the result. | ||
* | ||
* Returning `false` for directories causes the walker to not read their children. | ||
* @default true returned for all files. | ||
*/ | ||
filter?(pathDesc: IFileSystemDescriptor): boolean | ||
filterFile?(pathDesc: IFileSystemDescriptor): boolean | ||
/** | ||
* Optional directory filtering function that receives a directory descriptor and returns | ||
* whether it should be walked into. | ||
* | ||
* @default true returned for all directories. | ||
*/ | ||
filterDirectory?(pathDesc: IFileSystemDescriptor): boolean | ||
} | ||
@@ -168,0 +187,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41930
931