Skip to content

Commit 58ae498

Browse files
committed
Update SDK Documentation
1 parent 3a7b387 commit 58ae498

85 files changed

Lines changed: 18253 additions & 11130 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Žsrc/reference/modules/caido/http.mdβ€Ž

Lines changed: 97 additions & 97 deletions
Large diffs are not rendered by default.

β€Žsrc/reference/modules/extra/console.mdβ€Ž

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66

77
### Console
88

9-
> **Console**: `object`
9+
> **Console** = `object`
1010
1111
Console interface for logging.
1212

1313
Currently logs are only available in the backend logs.
1414
See the [documentation](https://docs.caido.io/report_bug.html#1-backend-logs) on how to retrieve them.
1515

16-
#### Type declaration
16+
#### Methods
1717

1818
##### debug()
1919

20+
> **debug**(`message`: `any`): `void`
21+
2022
Log a message with the debug level.
2123

2224
Usually used for troubleshooting purposes.
@@ -33,6 +35,8 @@ Usually used for troubleshooting purposes.
3335

3436
##### error()
3537

38+
> **error**(`message`: `any`): `void`
39+
3640
Log a message with the error level.
3741

3842
Usually used for critical errors.
@@ -49,6 +53,8 @@ Usually used for critical errors.
4953

5054
##### log()
5155

56+
> **log**(`message`: `any`): `void`
57+
5258
Log a message with the info level.
5359

5460
Usually used for general information.
@@ -65,6 +71,8 @@ Usually used for general information.
6571

6672
##### warn()
6773

74+
> **warn**(`message`: `any`): `void`
75+
6876
Log a message with the warn level.
6977

7078
Usually used for unexpected behaviors.
@@ -83,4 +91,4 @@ Usually used for unexpected behaviors.
8391

8492
### console
8593

86-
> **console**: [`Console`](console.md#console)
94+
> **console**: [`Console`](#console)

β€Žsrc/reference/modules/extra/sqlite.mdβ€Ž

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ await db.exec("INSERT INTO test (name) VALUES ('foo');");
2121

2222
#### Constructors
2323

24-
##### new Database()
24+
##### Constructor
2525

26-
> **new Database**(): [`Database`](sqlite.md#database)
26+
> **new Database**(): [`Database`](#database)
2727
2828
###### Returns
2929

30-
[`Database`](sqlite.md#database)
30+
[`Database`](#database)
3131

3232
#### Methods
3333

@@ -49,7 +49,7 @@ This method allows one or more SQL statements to be executed without returning a
4949

5050
##### prepare()
5151

52-
> **prepare**(`sql`: `string`): `Promise`\<[`Statement`](sqlite.md#statement)\>
52+
> **prepare**(`sql`: `string`): `Promise`\<[`Statement`](#statement)\>
5353
5454
Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html).
5555

@@ -61,7 +61,7 @@ Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3re
6161

6262
###### Returns
6363

64-
`Promise`\<[`Statement`](sqlite.md#statement)\>
64+
`Promise`\<[`Statement`](#statement)\>
6565

6666
***
6767

@@ -72,19 +72,19 @@ Instead, instances are created via the database.prepare() method.
7272

7373
#### Constructors
7474

75-
##### new Statement()
75+
##### Constructor
7676

77-
> **new Statement**(): [`Statement`](sqlite.md#statement)
77+
> **new Statement**(): [`Statement`](#statement)
7878
7979
###### Returns
8080

81-
[`Statement`](sqlite.md#statement)
81+
[`Statement`](#statement)
8282

8383
#### Methods
8484

8585
##### all()
8686

87-
> **all**\<`T`\>(...`params`: [`Parameter`](sqlite.md#parameter)[]): `Promise`\<`T`[]\>
87+
> **all**\<`T`\>(...`params`: [`Parameter`](#parameter)[]): `Promise`\<`T`[]\>
8888
8989
This method executes a prepared statement and returns all results as an array of objects.
9090
If the prepared statement does not return any results, this method returns an empty array.
@@ -100,15 +100,15 @@ The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_
100100

101101
| Parameter | Type | Description |
102102
| ------ | ------ | ------ |
103-
| ...`params` | [`Parameter`](sqlite.md#parameter)[] | The values to bind to the prepared statement. Named parameters are not supported. |
103+
| ...`params` | [`Parameter`](#parameter)[] | The values to bind to the prepared statement. Named parameters are not supported. |
104104

105105
###### Returns
106106

107107
`Promise`\<`T`[]\>
108108

109109
##### get()
110110

111-
> **get**\<`T`\>(...`params`: [`Parameter`](sqlite.md#parameter)[]): `Promise`\<`undefined` \| `T`\>
111+
> **get**\<`T`\>(...`params`: [`Parameter`](#parameter)[]): `Promise`\<`T` \| `undefined`\>
112112
113113
This method executes a prepared statement and returns the first result as an object.
114114
If the prepared statement does not return any results, this method returns undefined.
@@ -124,15 +124,15 @@ The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_
124124

125125
| Parameter | Type | Description |
126126
| ------ | ------ | ------ |
127-
| ...`params` | [`Parameter`](sqlite.md#parameter)[] | The values to bind to the prepared statement. Named parameters are not supported. |
127+
| ...`params` | [`Parameter`](#parameter)[] | The values to bind to the prepared statement. Named parameters are not supported. |
128128

129129
###### Returns
130130

131-
`Promise`\<`undefined` \| `T`\>
131+
`Promise`\<`T` \| `undefined`\>
132132

133133
##### run()
134134

135-
> **run**(...`params`: [`Parameter`](sqlite.md#parameter)[]): `Promise`\<[`Result`](sqlite.md#result)\>
135+
> **run**(...`params`: [`Parameter`](#parameter)[]): `Promise`\<[`Result`](#result)\>
136136
137137
This method executes a prepared statement and returns an object summarizing the resulting changes.
138138
The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the values in params.
@@ -141,19 +141,19 @@ The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_
141141

142142
| Parameter | Type | Description |
143143
| ------ | ------ | ------ |
144-
| ...`params` | [`Parameter`](sqlite.md#parameter)[] | The values to bind to the prepared statement. Named parameters are not supported. |
144+
| ...`params` | [`Parameter`](#parameter)[] | The values to bind to the prepared statement. Named parameters are not supported. |
145145

146146
###### Returns
147147

148-
`Promise`\<[`Result`](sqlite.md#result)\>
148+
`Promise`\<[`Result`](#result)\>
149149

150150
## Type Aliases
151151

152152
### OpenOptions
153153

154-
> **OpenOptions**: `object`
154+
> **OpenOptions** = `object`
155155
156-
#### Type declaration
156+
#### Properties
157157

158158
##### busyTimeout?
159159

@@ -268,15 +268,15 @@ true
268268

269269
### Parameter
270270

271-
> **Parameter**: `null` \| `number` \| `bigint` \| `string` \| `Uint8Array`
271+
> **Parameter** = `null` \| `number` \| `bigint` \| `string` \| `Uint8Array`
272272
273273
***
274274

275275
### Result
276276

277-
> **Result**: `object`
277+
> **Result** = `object`
278278
279-
#### Type declaration
279+
#### Properties
280280

281281
##### changes
282282

@@ -290,16 +290,16 @@ true
290290

291291
### open()
292292

293-
> **open**(`options`: [`OpenOptions`](sqlite.md#openoptions)): `Promise`\<[`Database`](sqlite.md#database)\>
293+
> **open**(`options`: [`OpenOptions`](#openoptions)): `Promise`\<[`Database`](#database)\>
294294
295295
Open a SQLite database.
296296

297297
#### Parameters
298298

299299
| Parameter | Type | Description |
300300
| ------ | ------ | ------ |
301-
| `options` | [`OpenOptions`](sqlite.md#openoptions) | The options to open the database. |
301+
| `options` | [`OpenOptions`](#openoptions) | The options to open the database. |
302302

303303
#### Returns
304304

305-
`Promise`\<[`Database`](sqlite.md#database)\>
305+
`Promise`\<[`Database`](#database)\>

β€Žsrc/reference/modules/extra/timers.mdβ€Ž

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,27 @@ scheduled actions.
1111

1212
#### Constructors
1313

14-
##### new Timeout()
14+
##### Constructor
1515

16-
> **new Timeout**(): [`Timeout`](timers.md#timeout)
16+
> **new Timeout**(): [`Timeout`](#timeout)
1717
1818
###### Returns
1919

20-
[`Timeout`](timers.md#timeout)
20+
[`Timeout`](#timeout)
2121

2222
## Functions
2323

2424
### clearInterval()
2525

26-
> **clearInterval**(`interval`: [`Timeout`](timers.md#timeout)): `void`
26+
> **clearInterval**(`interval`: [`Timeout`](#timeout)): `void`
2727
2828
Cancels a `Timeout` object created by `setInterval()`.
2929

3030
#### Parameters
3131

3232
| Parameter | Type |
3333
| ------ | ------ |
34-
| `interval` | [`Timeout`](timers.md#timeout) |
34+
| `interval` | [`Timeout`](#timeout) |
3535

3636
#### Returns
3737

@@ -41,15 +41,15 @@ Cancels a `Timeout` object created by `setInterval()`.
4141

4242
### clearTimeout()
4343

44-
> **clearTimeout**(`timeout`: [`Timeout`](timers.md#timeout)): `void`
44+
> **clearTimeout**(`timeout`: [`Timeout`](#timeout)): `void`
4545
4646
Cancels a `Timeout` object created by `setTimeout()`.
4747

4848
#### Parameters
4949

5050
| Parameter | Type | Description |
5151
| ------ | ------ | ------ |
52-
| `timeout` | [`Timeout`](timers.md#timeout) | A `Timeout` object as returned by [setTimeout](timers.md#settimeout). |
52+
| `timeout` | [`Timeout`](#timeout) | A `Timeout` object as returned by [setTimeout](#settimeout). |
5353

5454
#### Returns
5555

@@ -86,7 +86,7 @@ for use with clearImmediate
8686

8787
### setInterval()
8888

89-
> **setInterval**\<`TArgs`\>(`callback`: (...`args`: `TArgs`) => `void`, `ms`?: `number`): [`Timeout`](timers.md#timeout)
89+
> **setInterval**\<`TArgs`\>(`callback`: (...`args`: `TArgs`) => `void`, `ms?`: `number`): [`Timeout`](#timeout)
9090
9191
Schedules repeated execution of `callback` every `delay` milliseconds.
9292

@@ -103,19 +103,19 @@ When `delay` isless than `4`, the `delay` will be set to `4`.
103103
| Parameter | Type | Description |
104104
| ------ | ------ | ------ |
105105
| `callback` | (...`args`: `TArgs`) => `void` | The function to call when the timer elapses. |
106-
| `ms`? | `number` | - |
106+
| `ms?` | `number` | - |
107107

108108
#### Returns
109109

110-
[`Timeout`](timers.md#timeout)
110+
[`Timeout`](#timeout)
111111

112-
for use with [clearInterval](timers.md#clearinterval)
112+
for use with [clearInterval](#clearinterval)
113113

114114
***
115115

116116
### setTimeout()
117117

118-
> **setTimeout**\<`TArgs`\>(`callback`: (...`args`: `TArgs`) => `void`, `ms`?: `number`): [`Timeout`](timers.md#timeout)
118+
> **setTimeout**\<`TArgs`\>(`callback`: (...`args`: `TArgs`) => `void`, `ms?`: `number`): [`Timeout`](#timeout)
119119
120120
Schedules execution of a one-time `callback` after `delay` milliseconds.
121121

@@ -137,10 +137,10 @@ When `delay` is less than `4`, the `delay` will be set to `4`.
137137
| Parameter | Type | Description |
138138
| ------ | ------ | ------ |
139139
| `callback` | (...`args`: `TArgs`) => `void` | The function to call when the timer elapses. |
140-
| `ms`? | `number` | - |
140+
| `ms?` | `number` | - |
141141

142142
#### Returns
143143

144-
[`Timeout`](timers.md#timeout)
144+
[`Timeout`](#timeout)
145145

146-
for use with [clearTimeout](timers.md#cleartimeout)
146+
for use with [clearTimeout](#cleartimeout)
Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
# QuickJS Modules
2-
3-
Here is the reference of the modules available in our engine.
4-
5-
This documentation is auto-generated from the Typescript typing ([`@caido/quickjs-types`](https://www.npmjs.com/package/@caido/quickjs-types)) which is the source of truth.
6-
7-
Some elements are similar to `Node.JS`, but some imports will be different and start with `caido:`.
1+
# @caido/quickjs-types
82

93
## Modules
104

11-
| Module | Description | Import | Global |
12-
| -------------------------------------- | ------------------------ | ------------------ | ------ |
13-
| [url](extra/url.md) | URL utilities | N/A | βœ”οΈŽ |
14-
| [abort](llrt/abort.md) | Abort signaling | N/A | βœ”οΈŽ |
15-
| [buffer](llrt/buffer.md) | Buffers | `buffer` | βœ”οΈŽ |
16-
| [child_process](llrt/child_process.md) | Process spawning | `child_process` | ✘ |
17-
| [console](extra/console.md) | Console logging | N/A | βœ”οΈŽ |
18-
| [crypto](llrt/crypto.md) | Cryptographic primitives | `crypto` | ✘ |
19-
| [dom-events](llrt/dom-events.md) | Events | N/A | βœ”οΈŽ |
20-
| [fs](llrt/fs/index.md) | File system | `fs`, `fs/promise` | ✘ |
21-
| [http](caido/http.md) | Fetch implementation | `caido:http` | ✘ |
22-
| [globals](llrt/globals/index.md) | Global classes | N/A | βœ”οΈŽ |
23-
| [net](llrt/net.md) | Sockets | `net` | ✘ |
24-
| [os](extra/os.md) | OS information | `os` | ✘ |
25-
| [path](llrt/path/index.md) | Path transformation | `path` | ✘ |
26-
| [process](llrt/process.md) | Process information | `process` | βœ”οΈŽ |
27-
| [sqlite](extra/sqlite.md) | SQlite access | `sqlite` | ✘ |
28-
| [stream](llrt/stream.md) | Streams (basic) | `stream` | βœ”οΈŽ |
29-
| [timers](extra/timers.md) | Timers | N/A | βœ”οΈŽ |
5+
| Module | Description |
6+
| ------ | ------ |
7+
| [caido/http](caido/http.md) | - |
8+
| [extra/console](extra/console.md) | - |
9+
| [extra/os](extra/os.md) | - |
10+
| [extra/sqlite](extra/sqlite.md) | - |
11+
| [extra/timers](extra/timers.md) | - |
12+
| [llrt/abort](llrt/abort.md) | - |
13+
| [llrt/buffer](llrt/buffer.md) | - |
14+
| [llrt/child\_process](llrt/child_process.md) | - |
15+
| [llrt/crypto](llrt/crypto.md) | - |
16+
| [llrt/dom-events](llrt/dom-events.md) | - |
17+
| [llrt/fs](llrt/fs/index.md) | - |
18+
| [llrt/globals](llrt/globals/index.md) | - |
19+
| [llrt/net](llrt/net.md) | - |
20+
| [llrt/path](llrt/path/index.md) | - |
21+
| [llrt/process](llrt/process/index.md) | - |
22+
| [llrt/stream](llrt/stream/index.md) | - |

0 commit comments

Comments
Β (0)