You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 rivejä
1.4 KiB

  1. // Generated by typings
  2. // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5d6115f046550714a28caa3555f47a1aec114fe5/tmp/tmp.d.ts
  3. declare module "tmp" {
  4. namespace tmp {
  5. interface Options extends SimpleOptions {
  6. mode?: number;
  7. }
  8. interface SimpleOptions {
  9. prefix?: string;
  10. postfix?: string;
  11. template?: string;
  12. dir?: string;
  13. tries?: number;
  14. keep?: boolean;
  15. unsafeCleanup?: boolean;
  16. }
  17. interface SynchrounousResult {
  18. name: string;
  19. fd: number;
  20. removeCallback: () => void;
  21. }
  22. function file(callback: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
  23. function file(config: Options, callback?: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
  24. function fileSync(config?: Options): SynchrounousResult;
  25. function dir(callback: (err: any, path: string, cleanupCallback: () => void) => void): void;
  26. function dir(config: Options, callback?: (err: any, path: string, cleanupCallback: () => void) => void): void;
  27. function dirSync(config?: Options): SynchrounousResult;
  28. function tmpName(callback: (err: any, path: string) => void): void;
  29. function tmpName(config: SimpleOptions, callback?: (err: any, path: string) => void): void;
  30. function tmpNameSync(config?: SimpleOptions): string;
  31. function setGracefulCleanup(): void;
  32. }
  33. export = tmp;
  34. }