Skip to content

Commit 9765439

Browse files
committed
0.3.2 add upload to GMxhr
1 parent b17af06 commit 9765439

File tree

3 files changed

+190
-2
lines changed

3 files changed

+190
-2
lines changed

index.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ type TypedArray =
459459
| Float32Array
460460
| Float64Array;
461461

462-
interface GMRequestBase<T> {
462+
interface GMRequestBase<T> extends GMRequestBaseEvents<T> {
463463
/** URL relative to current page is also allowed. */
464464
url: string;
465465
/** User for authentication. */
@@ -482,6 +482,9 @@ interface GMRequestBase<T> {
482482
context?: unknown | undefined;
483483
/** When set to `true`, no cookie will be sent with the request and the response cookies will be ignored. The default value is `false`. */
484484
anonymous?: boolean | undefined;
485+
}
486+
487+
interface GMRequestBaseEvents<T> {
485488
onabort?: ((resp: VMScriptResponseObject<T>) => void) | undefined;
486489
onerror?: ((resp: VMScriptResponseObject<T>) => void) | undefined;
487490
onload?: ((resp: VMScriptResponseObject<T>) => void) | undefined;
@@ -520,6 +523,8 @@ declare interface VMScriptGMXHRDetails<T> extends GMRequestBase<T> {
520523
| undefined;
521524
/** Send the `data` string as a `blob`. This is for compatibility with Tampermonkey/Greasemonkey, where only `string` type is allowed in `data`. */
522525
binary?: boolean | undefined;
526+
/** @since VM2.32.0 */
527+
upload?: GMRequestBaseEvents<T>;
523528
}
524529

525530
/** Makes a request like XMLHttpRequest, with some special capabilities, not restricted by same-origin policy. */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@violentmonkey/types",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "Type declaration for GM functions in Violentmonkey",
55
"author": "Gerald <gera2ld@live.com>",
66
"main": "index.d.ts",

pnpm-lock.yaml

Lines changed: 183 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)