util.d.ts 1.2 KB

123456789101112131415161718
  1. import { Buffer } from '@jsonjoy.com/fs-node-builtins/lib/internal/buffer';
  2. import { TDataOut, TEncodingExtended } from './encoding';
  3. import type * as misc from '@jsonjoy.com/fs-node-utils/lib/types/misc';
  4. import type { StatError } from './types';
  5. export declare const isWin: boolean;
  6. type TData = TDataOut | ArrayBufferView | DataView;
  7. export declare const unixify: (filepath: string, stripTrailing?: boolean) => string;
  8. type TResolve = (filename: string, base?: string) => string;
  9. declare let resolve: TResolve;
  10. export { resolve };
  11. export declare const filenameToSteps: (filename: string, base?: string) => string[];
  12. export declare function isFd(path: any): boolean;
  13. export declare function validateFd(fd: any): void;
  14. export declare function dataToBuffer(data: TData, encoding?: TEncodingExtended): Buffer;
  15. export declare function nullCheck(path: any, callback?: any): boolean;
  16. export declare function pathToFilename(path: misc.PathLike): string;
  17. export declare function createError(errorCode: string, func?: string, path?: string, path2?: string, Constructor?: ErrorConstructor): Error;
  18. export declare function createStatError(errorCode: string, func?: string, path?: string, path2?: string): StatError;