Skip to content

Commit

Permalink
fix: add Nitro hooks types declarations (#2655)
Browse files Browse the repository at this point in the history
Co-authored-by: rorycai <[email protected]>
  • Loading branch information
Coiggahou2002 and rorycai authored Jun 7, 2024
1 parent adefdd2 commit ac66984
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { BuiltinLanguage as ShikiLang, BuiltinTheme as ShikiTheme, Language
import { joinURL, withLeadingSlash, withTrailingSlash } from 'ufo'
import { createStorage, type WatchEvent } from 'unstorage'
import { name, version } from '../package.json'
import type { MarkdownPlugin, QueryBuilderParams, QueryBuilderWhere } from './runtime/types'
import type { MarkdownPlugin, ParsedContent, QueryBuilderParams, QueryBuilderWhere } from './runtime/types'
import { makeIgnored } from './runtime/utils/config'
import {
CACHE_VERSION,
Expand Down Expand Up @@ -1053,3 +1053,11 @@ declare module '@nuxt/schema' {
content: ModulePrivateRuntimeConfig & ContentContext;
}
}

// Keep sync with src/runtime/server/storage.ts
declare module 'nitropack' {
interface NitroRuntimeHooks {
'content:file:beforeParse': (file: { _id: string; body: string }) => void;
'content:file:afterParse': (file: ParsedContent) => void;
}
}

0 comments on commit ac66984

Please sign in to comment.