chore: replace constructors with types (#3056)

This commit is contained in:
Daniel Roe 2022-02-03 18:02:55 +00:00 committed by GitHub
parent c82d3533bc
commit fae2179ee9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View File

@ -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)
} }

View File

@ -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()

View File

@ -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
} }
} }

View File

@ -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 {

View File

@ -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
} }

View File

@ -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 {