Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@toil/gm-types

ilyhalight419MIT1.0.4TypeScript support: included

All-in-One GM API types (Greasemonkey, Tampermonkey, Violentmonkey and etc)

gm, types, greasemonkey, tampermonkey, violentmonkey, userscripts, monkey

readme

GM API Types

All-in-One GM API types (Greasemonkey, Tampermonkey, Violentmonkey and etc)

Install

To install:

Bun:

bun install @toil/gm-types

NPM:

npm install @toil/gm-types

Usage

After installation add @toil/gm-types/v4 or/and @toil/gm-types/v3 to tsconfig.json

{
  "compilerOptions": {
    "types": ["@toil/gm-types/v3"]
    //...
  }
}

Supported APIs

Currently, only these APIs are supported (with their GM. alternatives):

  • GM_info
  • GM_notification
  • GM Storage (GM_getValue, GM_setValue and etc)
  • GM_addStyle
  • GM_xmlhttpRequest
  • GM_getResourceURL
  • GM_cookie

Supported Extensions

Supported userscript managers:

changelog

1.0.4

  • Added export XHRBody
  • Added VMXHROnErrorHandler
  • Updated types in XHRBody type
  • Fixed typo in some comments

1.0.3

  • Fixed setValue type value in GM. and GM_ APIs

1.0.2

  • Added addValueChangeListener and removeValueChangeListener in GM. and GM_ APIs
  • Improved type generics for setValue, setValues, getValue, getValues in GM. and GM_ APIs
  • Added support cookie in GM and GM_ APIs`
  • Fixed typo in Violentmonkey name

1.0.1

  • Fixed README

1.0.0

  • Initial release