Cache.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Copyright 2023 Google Inc. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import { Browser, BrowserPlatform } from './browser-data/browser-data.js';
  17. /**
  18. * @public
  19. */
  20. export interface InstalledBrowser {
  21. /**
  22. * Path to the root of the installation folder. Use
  23. * {@link computeExecutablePath} to get the path to the executable binary.
  24. */
  25. path: string;
  26. browser: Browser;
  27. buildId: string;
  28. platform: BrowserPlatform;
  29. }
  30. /**
  31. * The cache used by Puppeteer relies on the following structure:
  32. *
  33. * - rootDir
  34. * -- <browser1> | browserRoot(browser1)
  35. * ---- <platform>-<buildId> | installationDir()
  36. * ------ the browser-platform-buildId
  37. * ------ specific structure.
  38. * -- <browser2> | browserRoot(browser2)
  39. * ---- <platform>-<buildId> | installationDir()
  40. * ------ the browser-platform-buildId
  41. * ------ specific structure.
  42. * @internal
  43. */
  44. export declare class Cache {
  45. #private;
  46. constructor(rootDir: string);
  47. browserRoot(browser: Browser): string;
  48. installationDir(browser: Browser, platform: BrowserPlatform, buildId: string): string;
  49. clear(): void;
  50. uninstall(browser: Browser, platform: BrowserPlatform, buildId: string): void;
  51. getInstalledBrowsers(): InstalledBrowser[];
  52. }
  53. //# sourceMappingURL=Cache.d.ts.map