imagetools / Modules / core/src
- BackgroundOptions
- BlurOptions
- FitOptions
- FlattenOptions
- FlipOptions
- FlopOptions
- FormatOptions
- GrayscaleOptions
- HSBOptions
- ImageMetadata
- Img
- InvertOptions
- KernelOptions
- Logger
- LosslessOptions
- MedianOptions
- NormalizeOptions
- Picture
- PositionOptions
- ProcessedImageMetadata
- ProgressiveOptions
- QualityOptions
- ResizeOptions
- RotateOptions
- TintOptions
- TransformFactoryContext
- TransformResult
- FitValue
- FormatValue
- ImageConfig
- ImageTransformation
- KernelValue
- OutputFormat
- PositionValue
- TransformFactory
- TransformOption
- applyTransforms
- blur
- extractEntries
- flatten
- flip
- flop
- format
- generateImageID
- generateTransforms
- getBackground
- getFit
- getKernel
- getLossless
- getMetadata
- getPosition
- getProgressive
- getQuality
- grayscale
- hsb
- imgFormat
- invert
- loadImage
- median
- metadataFormat
- normalize
- parseURL
- pictureFormat
- resize
- resolveConfigs
- rotate
- setMetadata
- srcsetFormat
- tint
- urlFormat
Ƭ FitValue: typeof fitValues
[number
]
packages/core/src/transforms/fit.ts:6
Ƭ FormatValue: typeof formatValues
[number
]
packages/core/src/transforms/format.ts:10
Ƭ ImageConfig: Record
<string
, string
| string
[]>
Ƭ ImageTransformation: (image
: Sharp
) => Sharp
| Promise
<Sharp
>
▸ (image
): Sharp
| Promise
<Sharp
>
Name | Type |
---|---|
image |
Sharp |
Sharp
| Promise
<Sharp
>
Ƭ KernelValue: typeof kernelValues
[number
]
packages/core/src/transforms/kernel.ts:6
Ƭ OutputFormat: (args?
: string
[]) => (metadata
: ProcessedImageMetadata
[]) => unknown
▸ (args?
): (metadata
: ProcessedImageMetadata
[]) => unknown
The JS object returned by the image import.
Name | Type |
---|---|
args? |
string [] |
fn
▸ (metadata
): unknown
Name | Type |
---|---|
metadata |
ProcessedImageMetadata [] |
unknown
Ƭ PositionValue: typeof positionValues
[number
]
packages/core/src/transforms/position.ts:38
Ƭ TransformFactory<A
>: (metadata
: Partial
<ImageConfig
& A
>, ctx
: TransformFactoryContext
) => ImageTransformation
| undefined
Name | Type |
---|---|
A |
Record <string , unknown > |
▸ (metadata
, ctx
): ImageTransformation
| undefined
Name | Type |
---|---|
metadata |
Partial <ImageConfig & A > |
ctx |
TransformFactoryContext |
ImageTransformation
| undefined
Ƭ TransformOption<A
, T
>: (metadata
: Partial
<ImageConfig
& A
>, image
: Sharp
) => T
| undefined
Name | Type |
---|---|
A |
Record <string , unknown > |
T |
unknown |
▸ (metadata
, image
): T
| undefined
Name | Type |
---|---|
metadata |
Partial <ImageConfig & A > |
image |
Sharp |
T
| undefined
• Const
builtinOutputFormats: Object
Name | Type |
---|---|
img |
OutputFormat |
meta |
OutputFormat |
metadata |
OutputFormat |
picture |
OutputFormat |
srcset |
OutputFormat |
url |
OutputFormat |
packages/core/src/output-formats.ts:112
• Const
builtins: (TransformFactory
<BlurOptions
> | TransformFactory
<FlattenOptions
> | TransformFactory
<FlipOptions
> | TransformFactory
<FlopOptions
> | TransformFactory
<FormatOptions
> | TransformFactory
<GrayscaleOptions
> | TransformFactory
<HSBOptions
> | TransformFactory
<InvertOptions
> | TransformFactory
<MedianOptions
> | TransformFactory
<NormalizeOptions
> | TransformFactory
<ResizeOptions
> | TransformFactory
<RotateOptions
> | TransformFactory
<TintOptions
>)[]
packages/core/src/builtins.ts:15
• Const
fitValues: readonly ["cover"
, "contain"
, "fill"
, "inside"
, "outside"
]
packages/core/src/transforms/fit.ts:4
• Const
formatValues: readonly ["avif"
, "jpg"
, "jpeg"
, "png"
, "heif"
, "webp"
, "tiff"
]
packages/core/src/transforms/format.ts:8
• Const
kernelValues: readonly ["nearest"
, "cubic"
, "mitchell"
, "lanczos2"
, "lanczos3"
]
packages/core/src/transforms/kernel.ts:4
• Const
positionShorthands: string
[]
packages/core/src/transforms/position.ts:27
• Const
positionValues: readonly ["top"
, "right top"
, "right"
, "right bottom"
, "bottom"
, "left bottom"
, "left"
, "left top"
, "north"
, "northeast"
, "east"
, "southeast"
, "south"
, "southwest"
, "west"
, "northwest"
, "center"
, "centre"
, "entropy"
, "attention"
]
packages/core/src/transforms/position.ts:4
▸ applyTransforms(transforms
, image
, removeMetadata?
): Promise
<TransformResult
>
Name | Type | Default value |
---|---|---|
transforms |
ImageTransformation [] |
undefined |
image |
Sharp |
undefined |
removeMetadata |
boolean |
true |
Promise
<TransformResult
>
packages/core/src/lib/apply-transforms.ts:5
▸ blur(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & BlurOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ extractEntries(searchParams
): [string
, string
[]][]
Name | Type |
---|---|
searchParams |
URLSearchParams |
[string
, string
[]][]
packages/core/src/lib/parse-url.ts:5
▸ flatten(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & FlattenOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ flip(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & FlipOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ flop(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & FlopOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ format(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & FormatOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ generateImageID(url
, config
): string
Name | Type |
---|---|
url |
URL |
config |
ImageConfig |
string
▸ generateTransforms(config
, factories
, manualSearchParams
, logger?
): Object
Name | Type |
---|---|
config |
ImageConfig |
factories |
TransformFactory [] |
manualSearchParams |
URLSearchParams |
logger? |
Logger |
Object
Name | Type |
---|---|
parametersUsed |
Set <string > |
transforms |
ImageTransformation [] |
packages/core/src/lib/generate-transforms.ts:4
▸ getBackground(metadata
, image
): undefined
| string
Name | Type |
---|---|
metadata |
Partial <ImageConfig & BackgroundOptions > |
image |
Sharp |
undefined
| string
▸ getFit(metadata
, image
): undefined
| "cover"
| "contain"
| "fill"
| "inside"
| "outside"
Name | Type |
---|---|
metadata |
Partial <ImageConfig & FitOptions > |
image |
Sharp |
undefined
| "cover"
| "contain"
| "fill"
| "inside"
| "outside"
▸ getKernel(metadata
, image
): undefined
| "nearest"
| "cubic"
| "mitchell"
| "lanczos2"
| "lanczos3"
Name | Type |
---|---|
metadata |
Partial <ImageConfig & KernelOptions > |
image |
Sharp |
undefined
| "nearest"
| "cubic"
| "mitchell"
| "lanczos2"
| "lanczos3"
▸ getLossless(metadata
, image
): unknown
Name | Type |
---|---|
metadata |
Partial <ImageConfig & LosslessOptions > |
image |
Sharp |
unknown
▸ getMetadata(image
, key
): unknown
Name | Type |
---|---|
image |
Sharp |
key |
string |
unknown
packages/core/src/lib/metadata.ts:16
▸ getPosition(metadata
, image
): undefined
| "top"
| "right top"
| "right"
| "right bottom"
| "bottom"
| "left bottom"
| "left"
| "left top"
| "north"
| "northeast"
| "east"
| "southeast"
| "south"
| "southwest"
| "west"
| "northwest"
| "center"
| "centre"
| "entropy"
| "attention"
Name | Type |
---|---|
metadata |
Partial <ImageConfig & PositionOptions > |
image |
Sharp |
undefined
| "top"
| "right top"
| "right"
| "right bottom"
| "bottom"
| "left bottom"
| "left"
| "left top"
| "north"
| "northeast"
| "east"
| "southeast"
| "south"
| "southwest"
| "west"
| "northwest"
| "center"
| "centre"
| "entropy"
| "attention"
▸ getProgressive(metadata
, image
): unknown
Name | Type |
---|---|
metadata |
Partial <ImageConfig & ProgressiveOptions > |
image |
Sharp |
unknown
▸ getQuality(metadata
, image
): undefined
| number
Name | Type |
---|---|
metadata |
Partial <ImageConfig & QualityOptions > |
image |
Sharp |
undefined
| number
▸ grayscale(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & GrayscaleOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ hsb(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & HSBOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ imgFormat(args?
): (metadata
: ProcessedImageMetadata
[]) => unknown
The JS object returned by the image import.
Name | Type |
---|---|
args? |
string [] |
fn
▸ (metadata
): unknown
Name | Type |
---|---|
metadata |
ProcessedImageMetadata [] |
unknown
▸ invert(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & InvertOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ loadImage(path
): Sharp
Name | Type |
---|---|
path |
string |
Sharp
▸ median(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & MedianOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ metadataFormat(args?
): (metadata
: ProcessedImageMetadata
[]) => unknown
The JS object returned by the image import.
Name | Type |
---|---|
args? |
string [] |
fn
▸ (metadata
): unknown
Name | Type |
---|---|
metadata |
ProcessedImageMetadata [] |
unknown
▸ normalize(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & NormalizeOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ parseURL(rawURL
): URL
Name | Type |
---|---|
rawURL |
string |
URL
packages/core/src/lib/parse-url.ts:1
▸ pictureFormat(args?
): (metadata
: ProcessedImageMetadata
[]) => unknown
fallback format should be specified last
Name | Type |
---|---|
args? |
string [] |
fn
▸ (metadata
): unknown
Name | Type |
---|---|
metadata |
ProcessedImageMetadata [] |
unknown
▸ resize(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & ResizeOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ resolveConfigs(entries
, outputFormats
): Record
<string
, string
| string
[]>[]
This function builds up all possible combinations the given entries can be combined and returns it as an array of objects that can be given to a the transforms.
Name | Type | Description |
---|---|---|
entries |
[string , string []][] |
The url parameter entries |
outputFormats |
Record <string , OutputFormat > |
- |
Record
<string
, string
| string
[]>[]
An array of directive options
packages/core/src/lib/resolve-configs.ts:17
▸ rotate(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & RotateOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ setMetadata(image
, key
, value
): void
Name | Type |
---|---|
image |
Sharp |
key |
string |
value |
unknown |
void
packages/core/src/lib/metadata.ts:12
▸ srcsetFormat(args?
): (metadata
: ProcessedImageMetadata
[]) => unknown
The JS object returned by the image import.
Name | Type |
---|---|
args? |
string [] |
fn
▸ (metadata
): unknown
Name | Type |
---|---|
metadata |
ProcessedImageMetadata [] |
unknown
▸ tint(metadata
, ctx
): undefined
| ImageTransformation
Name | Type |
---|---|
metadata |
Partial <ImageConfig & TintOptions > |
ctx |
TransformFactoryContext |
undefined
| ImageTransformation
▸ urlFormat(args?
): (metadata
: ProcessedImageMetadata
[]) => unknown
The JS object returned by the image import.
Name | Type |
---|---|
args? |
string [] |
fn
▸ (metadata
): unknown
Name | Type |
---|---|
metadata |
ProcessedImageMetadata [] |
unknown