Reference

Hooks

The build-time hooks the module calls and registers.

Both hooks exist in nuxt dev only and are typed on NuxtHooks once the module is installed.

pglite:devtools:actions

(actions: PGliteSocketAction[]) => HookResult

Called once every module is set up, with the socket actions from pglite.socket.devtoolsActions, and only while the development socket runs. Push yours to the array:

nuxt.hook('pglite:devtools:actions', (actions) => {
  actions.push({ id: 'my-module:studio', label: 'Open the studio', run: () => {} })
})

Ids must be unique among socket actions; a duplicate fails the startup.

pglite:devtools:prompt

() => HookResult

Opens the action picker in the nuxt dev terminal. Registered only when the terminal is interactive and there are server or socket actions to pick from.

await nuxt.callHook('pglite:devtools:prompt')