utils.d.ts 1.3 KB

12345678910111213141516171819202122232425
  1. export declare function withTempDirectoryIn<T>(parentDirectory: string | undefined, fn: (directory: string) => Promise<T>): Promise<T>;
  2. export declare function withTempDirectory<T>(fn: (directory: string) => Promise<T>): Promise<T>;
  3. export declare function normalizeVersion(version: string): string;
  4. /**
  5. * Runs the `uname` command and returns the trimmed output.
  6. */
  7. export declare function uname(): string;
  8. /**
  9. * Generates an architecture name that would be used in an Electron or Node.js
  10. * download file name.
  11. */
  12. export declare function getNodeArch(arch: string): string;
  13. /**
  14. * Generates an architecture name that would be used in an Electron or Node.js
  15. * download file name, from the `process` module information.
  16. */
  17. export declare function getHostArch(): string;
  18. export declare function ensureIsTruthyString<T, K extends keyof T>(obj: T, key: K): void;
  19. export declare function isOfficialLinuxIA32Download(platform: string, arch: string, version: string, mirrorOptions?: object): boolean;
  20. /**
  21. * Find the value of a environment variable which may or may not have the
  22. * prefix, in a case-insensitive manner.
  23. */
  24. export declare function getEnv(prefix?: string): (name: string) => string | undefined;
  25. export declare function setEnv(key: string, value: string | undefined): void;