From 2c83f6ea6afd79ff9ba59a89d4ed669cb44c0a6c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 12 Dec 2020 15:46:54 +0100 Subject: [PATCH] feat: integrate $fetch with ohmyfetch --- packages/nitro/src/index.ts | 1 + packages/nitro/src/types.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 packages/nitro/src/types.ts diff --git a/packages/nitro/src/index.ts b/packages/nitro/src/index.ts index 01b14171aa..a66a35c2fb 100644 --- a/packages/nitro/src/index.ts +++ b/packages/nitro/src/index.ts @@ -1,4 +1,5 @@ import nuxt2 from './module/nuxt2' +export * from './types' export default function () { const { nuxt } = this diff --git a/packages/nitro/src/types.ts b/packages/nitro/src/types.ts new file mode 100644 index 0000000000..2c632eaff2 --- /dev/null +++ b/packages/nitro/src/types.ts @@ -0,0 +1,11 @@ +import type { $Fetch } from 'ohmyfetch' + +declare global { + const $fetch: $Fetch + + namespace NodeJS { + interface Global { + $fetch: $Fetch + } + } +}