UNPKG

gatsby-plugin-image

Version:

Adding responsive images to your site while maintaining high performance scores can be difficult to do manually. The Gatsby Image plugin handles the hard parts of producing images in multiple sizes and formats for you!

30 lines (29 loc) 1.37 kB
import { GatsbyCache, Reporter, ParentSpanPluginArgs, Actions } from "gatsby"; import type { FileSystemNode } from "gatsby-source-filesystem"; import { IStaticImageProps } from "../components/static-image.server"; import { ISharpGatsbyImageArgs } from "../image-utils"; export interface IImageMetadata { isFixed: boolean; contentDigest?: string; args: Record<string, unknown>; cacheFilename: string; } export declare function createImageNode({ fullPath, createNodeId, createNode, reporter, }: { fullPath: string; createNodeId: ParentSpanPluginArgs["createNodeId"]; createNode: Actions["createNode"]; reporter: Reporter; }): Promise<FileSystemNode | undefined>; export declare const isRemoteURL: (url: string) => boolean; export declare function writeImages({ images, pathPrefix, cacheDir, reporter, cache, sourceDir, createNodeId, createNode, filename, }: { images: Map<string, IStaticImageProps>; pathPrefix: string; cacheDir: string; reporter: Reporter; cache: GatsbyCache; sourceDir: string; createNodeId: ParentSpanPluginArgs["createNodeId"]; createNode: Actions["createNode"]; filename: string; }): Promise<void>; export declare function writeImage(file: FileSystemNode, args: ISharpGatsbyImageArgs, pathPrefix: string, reporter: Reporter, cache: GatsbyCache, filename: string): Promise<void>;