Browse Source

chore: use vm-types for GM_info.script.options

tophf 2 months ago
parent
commit
411776a110
3 changed files with 13 additions and 25 deletions
  1. 1 1
      package.json
  2. 1 20
      src/types.d.ts
  3. 11 4
      yarn.lock

+ 1 - 1
package.json

@@ -35,7 +35,7 @@
     "@types/jest": "^29.5.3",
     "@typescript-eslint/eslint-plugin": "^6.4.0",
     "@typescript-eslint/parser": "^6.4.0",
-    "@violentmonkey/types": "0.2.0",
+    "@violentmonkey/types": "^0.3.1",
     "@vue/compiler-sfc": "^3.4.38",
     "@vue/eslint-config-typescript": "^13.0.0",
     "amo-upload": "^0.5.5",

+ 1 - 20
src/types.d.ts

@@ -344,26 +344,7 @@ declare namespace VMInjection {
     injectInto: VMScriptInjectInto;
     key: { data: string, win: string };
     /** `resources` is still an object, converted later in makeGmApiWrapper */
-    meta: VMScript.Meta | VMScriptGMInfoScriptMeta | {
-      options: {
-        check_for_updates: boolean,
-        inject_into?: VMScriptInjectInto,
-        noframes: NumBoolNull,
-        override: {
-          merge_excludes: boolean,
-          merge_includes: boolean,
-          merge_matches: boolean,
-          merge_exclude_matches: boolean,
-          use_excludes: string[],
-          use_includes: string[],
-          use_matches: string[],
-          use_exclude_matches: string[],
-        },
-        run_at?: RunAt,
-        tags: string[],
-        user_modified?: number,
-      },
-    };
+    meta: VMScript.Meta | VMScriptGMInfoScriptMeta;
     metaStr: (string|number)[];
     pathMap: StringMap;
     runAt?: RunAt;

+ 11 - 4
yarn.lock

@@ -2214,10 +2214,12 @@
   dependencies:
     "@babel/runtime" "^7.16.7"
 
-"@violentmonkey/[email protected]":
-  version "0.2.0"
-  resolved "https://registry.yarnpkg.com/@violentmonkey/types/-/types-0.2.0.tgz#b66754f1ec74339fbc04d39ee4a1de259740b1b8"
-  integrity sha512-JRPtwhyodYKNkENciULg6v+ZtsoBR2ybYsA1KDvjw4JBzLNmvHixhd8TTl2s8eS1hU7MA1FU8kd1Ren9SCjxew==
+"@violentmonkey/[email protected]":
+  version "0.3.1"
+  resolved "https://registry.yarnpkg.com/@violentmonkey/types/-/types-0.3.1.tgz#b6bbd0e4074e16b214d258a0fcba95ecc986a40c"
+  integrity sha512-40pq15SRSgTU5JAL0f6NabSH5Q6OIgm2IUF1j0eSm1QMkJgsH/bNU72qW2QNAPa9MSRnoyfKoiY0bcDdnztIMw==
+  dependencies:
+    user-agent-data-types "^0.4.2"
 
 "@volar/[email protected]", "@volar/language-core@~2.4.0-alpha.18":
   version "2.4.0"
@@ -9935,6 +9937,11 @@ use@^3.1.0:
   resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
   integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==
 
+user-agent-data-types@^0.4.2:
+  version "0.4.2"
+  resolved "https://registry.yarnpkg.com/user-agent-data-types/-/user-agent-data-types-0.4.2.tgz#3bbd3662022c3fb9d0c2f7449b6cdd412a3f9e0d"
+  integrity sha512-jXep3kO/dGNmDOkbDa8ccp4QArgxR4I76m3QVcJ1aOF0B9toc+YtSXtX5gLdDTZXyWlpQYQrABr6L1L2GZOghw==
+
 util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"