2024-06-13 22:57:21 +08:00
|
|
|
|
import { PuppeteerLaunchOptions } from 'puppeteer';
|
2023-04-18 02:37:38 +08:00
|
|
|
|
import Puppeteer from './lib/puppeteer.js'
|
|
|
|
|
/**
|
|
|
|
|
*
|
2024-06-13 22:57:21 +08:00
|
|
|
|
* @param config
|
2023-04-18 02:37:38 +08:00
|
|
|
|
* @returns renderer 渲染器对象
|
|
|
|
|
* @returns renderer.id 渲染器ID,对应renderer中选择的id
|
|
|
|
|
* @returns renderer.type 渲染类型,保留字段,暂时支持image
|
|
|
|
|
* @returns renderer.render 渲染入口
|
2024-06-18 22:52:19 +08:00
|
|
|
|
* @deprecated 已废弃
|
2023-04-18 02:37:38 +08:00
|
|
|
|
*/
|
2024-06-13 22:57:21 +08:00
|
|
|
|
export default function (config?: PuppeteerLaunchOptions & {
|
2024-06-14 14:34:17 +08:00
|
|
|
|
chromiumPath?: string;
|
|
|
|
|
puppeteerWS?: any;
|
|
|
|
|
puppeteerTimeout?: any;
|
2024-06-13 22:57:21 +08:00
|
|
|
|
}) {
|
2023-04-18 02:37:38 +08:00
|
|
|
|
// TODO Puppeteer待简化重构
|
2023-09-15 08:15:25 +08:00
|
|
|
|
return new Puppeteer(config)
|
2023-04-18 02:37:38 +08:00
|
|
|
|
}
|