Skip to content

Commit

Permalink
add missing toolbar option in astro:server:setup
Browse files Browse the repository at this point in the history
It seems it was added in withastro/astro#7821 so in v4.7.0.
  • Loading branch information
ArmandPhilippot committed Jan 28, 2025
1 parent 04771cc commit f8eaa5a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/content/docs/en/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ interface AstroIntegration {
routes: IntegrationResolvedRoute[];
logger: AstroIntegrationLogger;
}) => void | Promise<void>;
'astro:server:setup'?: (options: { server: vite.ViteDevServer; logger: AstroIntegrationLogger; }) => void | Promise<void>;
'astro:server:setup'?: (options: {
server: vite.ViteDevServer;
logger: AstroIntegrationLogger;
toolbar: ReturnType<typeof getToolbarServerCommunicationHelpers>;
}) => void | Promise<void>;
'astro:server:start'?: (options: { address: AddressInfo; logger: AstroIntegrationLogger; }) => void | Promise<void>;
'astro:server:done'?: (options: { logger: AstroIntegrationLogger; }) => void | Promise<void>;
'astro:build:start'?: (options: { logger: AstroIntegrationLogger; }) => void | Promise<void>;
Expand Down Expand Up @@ -690,6 +694,7 @@ Allows you to adapt the logic of your integration depending on the user's projec
```js
'astro:server:setup'?: (options: {
server: vite.ViteDevServer;
toolbar: ReturnType<typeof getToolbarServerCommunicationHelpers>;
refreshContent: (options: {
loaders?: Array<string>;
context?: Record<string, any>;
Expand Down Expand Up @@ -717,6 +722,16 @@ export default {
}
```
#### `toolbar` option
<p>
**Type:** `ReturnType<typeof getToolbarServerCommunicationHelpers>`<br />
<Since v="4.7.0" />
</p>
Allows you to interact with the toolbar when the Astro's server is set up.
#### `refreshContent` option
<p>
Expand Down Expand Up @@ -769,7 +784,6 @@ You can also pass a `context` object to the loaders. This can be used to pass ar
The loader can then access the `refreshContextData` property to get the webhook body. See the [`refreshContextData`](/en/reference/content-loader-reference/#refreshcontextdata) property for more information.
### `astro:server:start`
**Previous hook:** [`astro:server:setup`](#astroserversetup)
Expand Down

0 comments on commit f8eaa5a

Please sign in to comment.