Skip to content

Commit

Permalink
fix: improve extensibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKruckenberg committed Mar 15, 2021
1 parent 70cd9cd commit 61d5a3d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Directive } from "imagetools-core/dist/types";
import { Directive, ImageConfig } from "imagetools-core/dist/types";

export type OutputFormat = (metadata: ImageConfig[]) => any

export interface PluginOptions {
/**
Expand All @@ -23,14 +25,13 @@ export interface PluginOptions {
* This list will be merged with the builtin directives before applying them to the input image.
* @default []
*/
directives: Directive[]
extendDirectives?: (builtins: Record<string, Directive>) => Record<string, Directive>

/**
* You can use this option to extend the builtin list of output formats.
* This list will be merged with the builtin output formats before determining the format to use.
* @default []
*/
// outputFormats: OutputFormat[]

/**
* By default vite-imagetools only generates output metadata during development mode
Expand All @@ -39,6 +40,7 @@ export interface PluginOptions {
* @default false
*/
force: boolean
extendOutputFormats?: (builtins: Record<string, OutputFormat>) => Record<string, OutputFormat>

/**
* Settings this option to true disables all warnings produced by this plugin
Expand Down

0 comments on commit 61d5a3d

Please sign in to comment.