@file-services/types
Advanced tools
Comparing version 5.4.0 to 5.7.0
@@ -1,2 +0,2 @@ | ||
import type { IFileSystemStats, BufferEncoding, WriteFileOptions, ReadFileOptions, IDirectoryEntry } from './common-fs-types.js'; | ||
import type { IFileSystemStats, BufferEncoding, WriteFileOptions, ReadFileOptions, IDirectoryEntry, StatSyncOptions } from './common-fs-types.js'; | ||
import type { IFileSystemPath } from './path.js'; | ||
@@ -84,7 +84,19 @@ import type { IWatchService } from './watch-api.js'; | ||
*/ | ||
statSync(path: string): IFileSystemStats; | ||
statSync(path: string, options?: StatSyncOptions & { | ||
throwIfNoEntry?: true; | ||
}): IFileSystemStats; | ||
statSync(path: string, options: StatSyncOptions & { | ||
throwIfNoEntry: false; | ||
}): IFileSystemStats | undefined; | ||
statSync(path: string, options?: StatSyncOptions): IFileSystemStats | undefined; | ||
/** | ||
* Get path's `IFileSystemStats`. Does not dereference symbolic links. | ||
*/ | ||
lstatSync(path: string): IFileSystemStats; | ||
lstatSync(path: string, options?: StatSyncOptions & { | ||
throwIfNoEntry?: true; | ||
}): IFileSystemStats; | ||
lstatSync(path: string, options: StatSyncOptions & { | ||
throwIfNoEntry: false; | ||
}): IFileSystemStats | undefined; | ||
lstatSync(path: string, options?: StatSyncOptions): IFileSystemStats | undefined; | ||
/** | ||
@@ -91,0 +103,0 @@ * Get the canonicalized absolute pathname. |
@@ -9,2 +9,9 @@ export declare type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'latin1' | 'binary' | 'hex'; | ||
export declare type CallbackFnVoid = (error?: Error | null) => void; | ||
export interface StatSyncOptions { | ||
/** | ||
* Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. | ||
* @default true | ||
*/ | ||
throwIfNoEntry?: boolean; | ||
} | ||
export declare type WriteFileOptions = { | ||
@@ -11,0 +18,0 @@ encoding?: BufferEncoding | null; |
{ | ||
"name": "@file-services/types", | ||
"description": "Common file system interfaces", | ||
"version": "5.4.0", | ||
"version": "5.7.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -7,2 +7,3 @@ import type { | ||
IDirectoryEntry, | ||
StatSyncOptions, | ||
} from './common-fs-types.js'; | ||
@@ -93,3 +94,5 @@ import type { IFileSystemPath } from './path.js'; | ||
*/ | ||
statSync(path: string): IFileSystemStats; | ||
statSync(path: string, options?: StatSyncOptions & { throwIfNoEntry?: true }): IFileSystemStats; | ||
statSync(path: string, options: StatSyncOptions & { throwIfNoEntry: false }): IFileSystemStats | undefined; | ||
statSync(path: string, options?: StatSyncOptions): IFileSystemStats | undefined; | ||
@@ -99,3 +102,5 @@ /** | ||
*/ | ||
lstatSync(path: string): IFileSystemStats; | ||
lstatSync(path: string, options?: StatSyncOptions & { throwIfNoEntry?: true }): IFileSystemStats; | ||
lstatSync(path: string, options: StatSyncOptions & { throwIfNoEntry: false }): IFileSystemStats | undefined; | ||
lstatSync(path: string, options?: StatSyncOptions): IFileSystemStats | undefined; | ||
@@ -102,0 +107,0 @@ /** |
@@ -23,2 +23,10 @@ export type BufferEncoding = | ||
export interface StatSyncOptions { | ||
/** | ||
* Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. | ||
* @default true | ||
*/ | ||
throwIfNoEntry?: boolean; | ||
} | ||
export type WriteFileOptions = | ||
@@ -25,0 +33,0 @@ | { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
75885
1619