Skip to content

Commit 2b9627e

Browse files
committed
fix api ref generation
1 parent 9364a68 commit 2b9627e

File tree

10 files changed

+97
-79
lines changed

10 files changed

+97
-79
lines changed

bun.lock

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

docs/content/fake-browser/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

docs/content/isolated-element/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

docs/content/job-scheduler/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

docs/content/match-patterns/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

docs/content/messaging/api.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

@@ -19,7 +21,7 @@ interface BaseMessagingConfig {
1921

2022
Shared configuration between all the different messengers.
2123

22-
### Properties
24+
### Properties
2325

2426
- ***`logger?: Logger`*** (default: `console`)<br/>The logger to use when logging messages. Set to `null` to disable logging.
2527

@@ -35,7 +37,7 @@ interface CustomEventMessage {
3537

3638
Additional fields available on the `Message` from a `CustomEventMessenger`.
3739

38-
### Properties
40+
### Properties
3941

4042
- ***`event: CustomEvent`***<br/>The event that was fired, resulting in the message being passed.
4143

@@ -153,7 +155,7 @@ interface ExtensionMessage {
153155

154156
Additional fields available on the `Message` from an `ExtensionMessenger`.
155157

156-
### Properties
158+
### Properties
157159

158160
- ***`sender: Runtime.MessageSender`***<br/>Information about where the message came from. See
159161
[`Runtime.MessageSender`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender).
@@ -196,6 +198,12 @@ interface GenericMessenger<
196198
TMessageExtension,
197199
TSendMessageArgs extends any[],
198200
> {
201+
sendMessage<TType extends keyof TProtocolMap>(
202+
type: TType,
203+
...args: GetDataType<TProtocolMap[TType]> extends undefined
204+
? [data?: undefined, ...args: TSendMessageArgs]
205+
: never
206+
): Promise<GetReturnType<TProtocolMap[TType]>>;
199207
sendMessage<TType extends keyof TProtocolMap>(
200208
type: TType,
201209
data: GetDataType<TProtocolMap[TType]>,
@@ -283,7 +291,7 @@ interface Message<
283291

284292
Contains information about the message received.
285293

286-
### Properties
294+
### Properties
287295

288296
- ***`id: number`***<br/>A semi-unique, auto-incrementing number used to trace messages being sent.
289297

@@ -306,7 +314,7 @@ interface MessageSender {
306314

307315
An object containing information about the script context that sent a message or request.
308316

309-
### Properties
317+
### Properties
310318

311319
- ***`tab?: Tabs.Tab`***<br/>The $(ref:tabs.Tab) which opened the connection, if any. This property will <strong>only</strong>
312320
be present when the connection was opened from a tab (including content scripts), and <strong>only</strong>
@@ -332,7 +340,7 @@ interface NamespaceMessagingConfig extends BaseMessagingConfig {
332340
}
333341
```
334342

335-
### Properties
343+
### Properties
336344

337345
- ***`namespace: string`***<br/>A string used to ensure the messenger only sends messages to and listens for messages from
338346
other messengers of the same type, with the same namespace.
@@ -354,7 +362,7 @@ Used to add a return type to a message in the protocol map.
354362

355363
> Internally, this is just an object with random keys for the data and return types.
356364
357-
### Properties
365+
### Properties
358366

359367
- ***`BtVgCTPYZu: TData`***<br/>Stores the data type. Randomly named so that it isn't accidentally implemented.
360368

@@ -392,7 +400,7 @@ interface SendMessageOptions {
392400

393401
Options for sending a message to a specific tab/frame
394402

395-
### Properties
403+
### Properties
396404

397405
- ***`tabId: number`***<br/>The tab to send a message to
398406

@@ -429,4 +437,4 @@ details.
429437

430438
---
431439

432-
_API reference generated by [`docs/generate-api-references.ts`](https://github.com/aklinker1/webext-core/blob/main/docs/generate-api-references.ts)_
440+
_API reference generated by [`docs/generate-api-references.ts`](https://github.com/aklinker1/webext-core/blob/main/docs/generate-api-references.ts)_

docs/content/proxy-service/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

docs/content/storage/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- GENERATED FILE, DO NOT EDIT -->
22

3-
# API Reference
3+
---
4+
description: ""
5+
---
46

57
::alert
68

docs/generate-api-references.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ async function renderDocs(
234234
const sections = [
235235
// Header
236236
`<!-- GENERATED FILE, DO NOT EDIT -->`,
237-
`---`,
238-
`description: ""`,
239-
`---`,
237+
`---\ndescription: ""\n---`,
240238
`::alert`,
241239
`See [\`@webext-core/${projectDirname}\`](/${projectDirname}/installation/)`,
242240
`::`,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@vitest/coverage-v8": "^2.1.1",
2222
"@webext-core/fake-browser": "workspace:*",
2323
"lint-staged": "^15.2.9",
24-
"listr2": "^6.4.2",
24+
"listr2": "^9.0.5",
2525
"playwright": "^1.47.0",
2626
"prettier": "^3.3.3",
2727
"simple-git-hooks": "^2.13.1",

0 commit comments

Comments
 (0)