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 })
|
||||
|
||||
useNuxt().hook('autoImports:dirs', (autoImportDirs: String[]) => {
|
||||
useNuxt().hook('autoImports:dirs', (autoImportDirs: string[]) => {
|
||||
for (const dir of (Array.isArray(_autoImportDirs) ? _autoImportDirs : [_autoImportDirs])) {
|
||||
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 = {}) {
|
||||
const nuxt = useNuxt()
|
||||
|
||||
|
@ -7,7 +7,7 @@ import { globby } from 'globby'
|
||||
import virtual from './virtual'
|
||||
|
||||
export interface AssetOptions {
|
||||
inline: Boolean
|
||||
inline: boolean
|
||||
dirs: {
|
||||
[assetdir: string]: {
|
||||
dir: string
|
||||
@ -17,10 +17,10 @@ export interface AssetOptions {
|
||||
}
|
||||
|
||||
interface Asset {
|
||||
fsPath: string,
|
||||
fsPath: string
|
||||
meta: {
|
||||
type?: string,
|
||||
etag?: string,
|
||||
type?: string
|
||||
etag?: string
|
||||
mtime?: string
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export interface NuxtCompatibility {
|
||||
* - `true`: When using Nuxt 2, using bridge module is required
|
||||
* - `false`: When using Nuxt 2, using bridge module is not supported
|
||||
*/
|
||||
bridge?: Boolean
|
||||
bridge?: boolean
|
||||
}
|
||||
|
||||
export interface NuxtCompatibilityIssue {
|
||||
|
@ -90,5 +90,5 @@ export interface ComponentsDir extends ScanDir {
|
||||
|
||||
export interface ComponentsOptions {
|
||||
dirs: (string | ComponentsDir)[]
|
||||
loader?: Boolean
|
||||
loader?: boolean
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export interface AutoImport {
|
||||
/**
|
||||
* Disable auto import
|
||||
*/
|
||||
disabled?: Boolean
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
export interface AutoImportSource {
|
||||
@ -34,7 +34,7 @@ export interface AutoImportSource {
|
||||
/**
|
||||
* Disable auto import source
|
||||
*/
|
||||
disabled?: Boolean
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
export interface AutoImportsOptions {
|
||||
|
Loading…
Reference in New Issue
Block a user