edge 扩展 chrome 类型(a edge extends types)
在 edge 扩展中使用的 chrome 的数据类型
安装
- npm
- yarn
- pnpm
npm install a-edge-extends-types --save-dev
yarn add a-edge-extends-types --dev
pnpm add a-edge-extends-types --save-dev
使用
需在项目的根目录添加 chrome.d.ts 文件,文件内容:
import { Chrome } from 'a-edge-extends-types';
declare global {
interface Window {
chrome: Chrome;
}
const chrome: Chrome;
}
包会在安装或是更新时自动写入该文件,若没有。则需要使用 npx immm 创建该文件,并保证 tsconfig.json 能正确的识别到该文件即可
说明
当前仅给出了特别少的一部分,如下列表:
action(啥也没有)i18n(全部)contextMenus(貌似全部)devtools(all)tts(全部)runtimeonloadsendMessageonMessageaddListener
storage(全部)tabs(全部)