@io-arc/types

Boilerplate TypeScript global types.

Usage#

$ npm i @io-arc/types
index.ts
import { TDirName } from '@io-arc/types'
const foo: TDirName = 'xxxx'

Type#

definetypedescription
TDirNamestringDirectory name with slash for last
TDirNameKeystringDirectory name with no slash for last
TDirPathKeystringDirectory path with no slash for last
TFileNamestringFilename with extension
TFileNameKeystringFilename with no extension
TFilePathstringFull filepath with extension
TTaskNamestringTask name
TGlobPatternstringGlob pattern
TJsonStringstringUsing JSON.stringify
TUrlstringURL
TWebpackModenone | development | productionWebpack build mode

Interface#

IfGif2WebpOptions#

Gif to webp convert options.
See options of imagemin-gif2webp.

interface IfGif2WebpOptions {
lossy?: boolean
mixed?: boolean
quality?: number
method?: number
minimize?: boolean
kmin?: number
kmax?: number
filter?: number
metadata?: string
multiThreading?: boolean
buffer?: Buffer
}

IfWebpConverterConfig#

Webp convert configure.

interface IfWebpConverterConfig {
// Target directories name array for image files used converter
target: TDirNameKey[]
ext: {
png: boolean
jpg: boolean
gif: boolean
}
// Output directories name array
output?: TDirNameKey[]
options?: imageminWebp.Options
gifOptions?: IfGif2WebpOptions
// Delete the webp file before starting the task.
deleteBefore?: boolean
}

imageminWebp.Options is "PNG/JPEG" webp convert options.
See options of imagemin-webp.