mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 01:15:58 +00:00
chore: replace constructors with types (#3056)
This commit is contained in:
parent
c82d3533bc
commit
fae2179ee9
@ -12,10 +12,10 @@ export function addAutoImport (_autoImports: AutoImport | AutoImport[]) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addAutoImportDir (_autoImportDirs: String | String[]) {
|
export function addAutoImportDir (_autoImportDirs: string | string[]) {
|
||||||
assertNuxtCompatibility({ bridge: true })
|
assertNuxtCompatibility({ bridge: true })
|
||||||
|
|
||||||
useNuxt().hook('autoImports:dirs', (autoImportDirs: String[]) => {
|
useNuxt().hook('autoImports:dirs', (autoImportDirs: string[]) => {
|
||||||
for (const dir of (Array.isArray(_autoImportDirs) ? _autoImportDirs : [_autoImportDirs])) {
|
for (const dir of (Array.isArray(_autoImportDirs) ? _autoImportDirs : [_autoImportDirs])) {
|
||||||
autoImportDirs.push(dir)
|
autoImportDirs.push(dir)
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ export function normalizePlugin (plugin: NuxtPlugin | string): NuxtPlugin {
|
|||||||
* })
|
* })
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export interface AddPluginOptions { append?: Boolean }
|
export interface AddPluginOptions { append?: boolean }
|
||||||
export function addPlugin (_plugin: NuxtPlugin | string, opts: AddPluginOptions = {}) {
|
export function addPlugin (_plugin: NuxtPlugin | string, opts: AddPluginOptions = {}) {
|
||||||
const nuxt = useNuxt()
|
const nuxt = useNuxt()
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import { globby } from 'globby'
|
|||||||
import virtual from './virtual'
|
import virtual from './virtual'
|
||||||
|
|
||||||
export interface AssetOptions {
|
export interface AssetOptions {
|
||||||
inline: Boolean
|
inline: boolean
|
||||||
dirs: {
|
dirs: {
|
||||||
[assetdir: string]: {
|
[assetdir: string]: {
|
||||||
dir: string
|
dir: string
|
||||||
@ -17,10 +17,10 @@ export interface AssetOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Asset {
|
interface Asset {
|
||||||
fsPath: string,
|
fsPath: string
|
||||||
meta: {
|
meta: {
|
||||||
type?: string,
|
type?: string
|
||||||
etag?: string,
|
etag?: string
|
||||||
mtime?: string
|
mtime?: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ export interface NuxtCompatibility {
|
|||||||
* - `true`: When using Nuxt 2, using bridge module is required
|
* - `true`: When using Nuxt 2, using bridge module is required
|
||||||
* - `false`: When using Nuxt 2, using bridge module is not supported
|
* - `false`: When using Nuxt 2, using bridge module is not supported
|
||||||
*/
|
*/
|
||||||
bridge?: Boolean
|
bridge?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NuxtCompatibilityIssue {
|
export interface NuxtCompatibilityIssue {
|
||||||
|
@ -90,5 +90,5 @@ export interface ComponentsDir extends ScanDir {
|
|||||||
|
|
||||||
export interface ComponentsOptions {
|
export interface ComponentsOptions {
|
||||||
dirs: (string | ComponentsDir)[]
|
dirs: (string | ComponentsDir)[]
|
||||||
loader?: Boolean
|
loader?: boolean
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ export interface AutoImport {
|
|||||||
/**
|
/**
|
||||||
* Disable auto import
|
* Disable auto import
|
||||||
*/
|
*/
|
||||||
disabled?: Boolean
|
disabled?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutoImportSource {
|
export interface AutoImportSource {
|
||||||
@ -34,7 +34,7 @@ export interface AutoImportSource {
|
|||||||
/**
|
/**
|
||||||
* Disable auto import source
|
* Disable auto import source
|
||||||
*/
|
*/
|
||||||
disabled?: Boolean
|
disabled?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutoImportsOptions {
|
export interface AutoImportsOptions {
|
||||||
|
Loading…
Reference in New Issue
Block a user