fix(nuxt3): explicitly declare type exports (#2850)

This commit is contained in:
Daniel Roe 2022-01-21 11:42:41 +00:00 committed by GitHub
parent 3b72b318e2
commit ae34f470a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions

View File

@ -1,7 +1,10 @@
export { defineNuxtComponent } from './component' export { defineNuxtComponent } from './component'
export { AsyncDataOptions, AsyncData, useAsyncData, useLazyAsyncData } from './asyncData' export { useAsyncData, useLazyAsyncData } from './asyncData'
export type { AsyncDataOptions, AsyncData } from './asyncData'
export { useHydration } from './hydrate' export { useHydration } from './hydrate'
export { useState } from './state' export { useState } from './state'
export { FetchResult, UseFetchOptions, useFetch, useLazyFetch } from './fetch' export { useFetch, useLazyFetch } from './fetch'
export { CookieOptions, CookieRef, useCookie } from './cookie' export type { FetchResult, UseFetchOptions } from './fetch'
export { useCookie } from './cookie'
export type { CookieOptions, CookieRef } from './cookie'
export { useRequestHeaders } from './ssr' export { useRequestHeaders } from './ssr'

View File

@ -53,15 +53,6 @@ describe('auto-imports:transform', () => {
const excludedNuxtHelpers = ['useHydration'] const excludedNuxtHelpers = ['useHydration']
const typeExports = [
'AsyncDataOptions',
'AsyncData',
'FetchResult',
'UseFetchOptions',
'CookieOptions',
'CookieRef'
]
describe('auto-imports:nuxt3', () => { describe('auto-imports:nuxt3', () => {
try { try {
const { __dirname } = createCommonJS(import.meta.url) const { __dirname } = createCommonJS(import.meta.url)
@ -69,7 +60,7 @@ describe('auto-imports:nuxt3', () => {
const names = findExports(entrypointContents).flatMap(i => i.names || i.name) const names = findExports(entrypointContents).flatMap(i => i.names || i.name)
for (const name of names) { for (const name of names) {
if (excludedNuxtHelpers.includes(name) || typeExports.includes(name)) { if (excludedNuxtHelpers.includes(name)) {
continue continue
} }
it(`should register ${name} globally`, () => { it(`should register ${name} globally`, () => {