@ricsam/quickjs-core 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/package.json +1 -1
- package/dist/types/quickjs.d.ts +96 -0
- package/package.json +4 -1
package/dist/cjs/package.json
CHANGED
package/dist/mjs/package.json
CHANGED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuickJS Global Type Definitions for @ricsam/quickjs-core
|
|
3
|
+
*
|
|
4
|
+
* These types define the globals injected by setupCore() into a QuickJS context.
|
|
5
|
+
* Use these types to typecheck user code that will run inside QuickJS.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // In your tsconfig.quickjs.json
|
|
9
|
+
* {
|
|
10
|
+
* "compilerOptions": {
|
|
11
|
+
* "lib": ["ESNext", "DOM"]
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* // Then reference this file or use ts-morph for code strings
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export {};
|
|
19
|
+
|
|
20
|
+
declare global {
|
|
21
|
+
// ============================================
|
|
22
|
+
// Web Streams API
|
|
23
|
+
// ============================================
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A readable stream of data.
|
|
27
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
|
|
28
|
+
*/
|
|
29
|
+
const ReadableStream: typeof globalThis.ReadableStream;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A writable stream of data.
|
|
33
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/WritableStream
|
|
34
|
+
*/
|
|
35
|
+
const WritableStream: typeof globalThis.WritableStream;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A transform stream that can be used to pipe data through a transformer.
|
|
39
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/TransformStream
|
|
40
|
+
*/
|
|
41
|
+
const TransformStream: typeof globalThis.TransformStream;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Default reader for ReadableStream
|
|
45
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader
|
|
46
|
+
*/
|
|
47
|
+
const ReadableStreamDefaultReader: typeof globalThis.ReadableStreamDefaultReader;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Default writer for WritableStream
|
|
51
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter
|
|
52
|
+
*/
|
|
53
|
+
const WritableStreamDefaultWriter: typeof globalThis.WritableStreamDefaultWriter;
|
|
54
|
+
|
|
55
|
+
// ============================================
|
|
56
|
+
// Blob and File APIs
|
|
57
|
+
// ============================================
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A file-like object of immutable, raw data.
|
|
61
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Blob
|
|
62
|
+
*/
|
|
63
|
+
const Blob: typeof globalThis.Blob;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A file object representing a file.
|
|
67
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/File
|
|
68
|
+
*/
|
|
69
|
+
const File: typeof globalThis.File;
|
|
70
|
+
|
|
71
|
+
// ============================================
|
|
72
|
+
// URL APIs
|
|
73
|
+
// ============================================
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Interface for URL manipulation.
|
|
77
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/URL
|
|
78
|
+
*/
|
|
79
|
+
const URL: typeof globalThis.URL;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Utility for working with URL query strings.
|
|
83
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
|
84
|
+
*/
|
|
85
|
+
const URLSearchParams: typeof globalThis.URLSearchParams;
|
|
86
|
+
|
|
87
|
+
// ============================================
|
|
88
|
+
// Error Handling
|
|
89
|
+
// ============================================
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Exception type for DOM operations.
|
|
93
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
94
|
+
*/
|
|
95
|
+
const DOMException: typeof globalThis.DOMException;
|
|
96
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/quickjs-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"main": "./dist/cjs/index.cjs",
|
|
5
5
|
"types": "./dist/types/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"types": "./dist/types/index.d.ts",
|
|
9
9
|
"require": "./dist/cjs/index.cjs",
|
|
10
10
|
"import": "./dist/mjs/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"./quickjs": {
|
|
13
|
+
"types": "./dist/types/quickjs.d.ts"
|
|
11
14
|
}
|
|
12
15
|
},
|
|
13
16
|
"scripts": {
|