@sparticuz/chromium
Version:
Chromium Binary for Serverless Platforms
51 lines (50 loc) • 1.83 kB
text/typescript
//#region source/helper.d.ts
/**
* Adds the proper folders to the environment
* @param baseLibPath the path to this packages lib folder
*/
declare const setupLambdaEnvironment: (baseLibPath: string) => void;
//#endregion
//#region source/lambdafs.d.ts
/**
* Decompresses a (tarballed) Brotli or Gzip compressed file and returns the path to the decompressed file/folder.
*
* @param filePath Path of the file to decompress.
*/
declare const inflate: (filePath: string) => Promise<string>;
//#endregion
//#region source/index.d.ts
declare class Chromium {
/**
* Returns a list of additional Chromium flags recommended for serverless environments.
* The canonical list of flags can be found on https://peter.sh/experiments/chromium-command-line-switches/.
* Most of below can be found here: https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
*/
static get args(): string[];
/**
* Returns whether the graphics stack is enabled or disabled
* @returns boolean
*/
static get graphics(): boolean;
/**
* Sets whether the graphics stack is enabled or disabled.
* @param true means the stack is enabled. WebGL will work.
* @param false means that the stack is disabled. WebGL will not work.
* @default true
*/
static set setGraphicsMode(value: boolean);
/**
* If true, the graphics stack and webgl is enabled,
* If false, webgl will be disabled.
* (If false, the swiftshader.tar.br file will also not extract)
*/
private static graphicsMode;
/**
* Inflates the included version of Chromium
* @param input The location of the `bin` folder
* @returns The path to the `chromium` binary
*/
static executablePath(input?: string): Promise<string>;
}
//#endregion
export { Chromium as default, inflate, setupLambdaEnvironment };