UI for Zipcoin Blue

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /// <reference types="node" />
  2. import * as fs from 'fs';
  3. import * as ncpType from 'ncp';
  4. export declare const ERROR_FILE_NOT_FOUND = "FILE_NOT_FOUND";
  5. export declare const ERROR_FILE_INVALID_JSON = "FILE_INVALID_JSON";
  6. export declare const ERROR_OVERWRITE_DENIED = "OVERWRITE_DENIED";
  7. export interface FSReadFileOptions {
  8. encoding: string;
  9. flag?: string;
  10. }
  11. export interface FSWriteFileOptions {
  12. encoding: string;
  13. mode?: number;
  14. flag?: string;
  15. }
  16. export declare const fsAccess: (arg1: string, arg2: number) => Promise<void>;
  17. export declare const fsMkdir: (arg1: string, arg2: number) => Promise<void>;
  18. export declare const fsOpen: (arg1: string, arg2: string) => Promise<number>;
  19. export declare const fsStat: (arg1: string) => Promise<fs.Stats>;
  20. export declare const fsUnlink: (arg1: string) => Promise<void>;
  21. export declare const fsReadFile: (arg1: string, arg2: FSReadFileOptions) => Promise<string>;
  22. export declare const fsWriteFile: (arg1: string, arg2: any, arg3: FSWriteFileOptions) => Promise<void>;
  23. export declare const fsReadDir: (arg1: string) => Promise<string[]>;
  24. export declare function readDir(filePath: string): Promise<string[]>;
  25. export declare function fsReadJsonFile(filePath: string, options?: FSReadFileOptions): Promise<{
  26. [key: string]: any;
  27. }>;
  28. export declare function fsWriteJsonFile(filePath: string, json: {
  29. [key: string]: any;
  30. }, options: FSWriteFileOptions): Promise<void>;
  31. export declare function fileToString(filepath: string): Promise<string>;
  32. export declare function fsMkdirp(p: string, mode?: number): Promise<void>;
  33. export declare function getFileChecksum(filePath: string): Promise<string>;
  34. /**
  35. * Return true and cached checksums for a file by its path.
  36. *
  37. * Cached checksums are stored as `.md5` files next to the original file. If
  38. * the cache file is missing, the cached checksum is undefined.
  39. *
  40. * @param p The file path
  41. * @return Promise<[true checksum, cached checksum or undefined if cache file missing]>
  42. */
  43. export declare function getFileChecksums(p: string): Promise<[string, string | undefined]>;
  44. /**
  45. * Store a cache file containing the source file's md5 checksum hash.
  46. *
  47. * @param p The file path
  48. * @param checksum The checksum. If excluded, the checksum is computed
  49. */
  50. export declare function cacheFileChecksum(p: string, checksum?: string): Promise<void>;
  51. export declare function writeStreamToFile(stream: NodeJS.ReadableStream, destination: string): Promise<any>;
  52. export declare function copyDirectory(source: string, destination: string, options?: ncpType.Options): Promise<void>;
  53. export declare function removeDirectory(dir: string): Promise<void>;
  54. export declare function copyFile(fileName: string, target: string, mode?: number): Promise<{}>;
  55. export declare function pathAccessible(filePath: string, mode: number): Promise<boolean>;
  56. export declare function pathExists(filePath: string): Promise<boolean>;
  57. /**
  58. * Find the base directory based on the path given and a marker file to look for.
  59. */
  60. export declare function findBaseDirectory(dir: string, file: string): Promise<string | undefined>;