mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt3): explicitly declare type exports (#2850)
This commit is contained in:
parent
3b72b318e2
commit
ae34f470a0
@ -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'
|
||||||
|
@ -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`, () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user