Skip to main content

Interface: ScreenshotStorage

mugshot.ScreenshotStorage

A way to read and write screenshots.

It's up to the implementation to decide where and how to write the screenshots. All the methods receive the name of the screenshot which is the same value as the name passed in Mugshot.check.

Implemented by#

Properties#

delete#

delete: (name: string) => Promise<void>

Delete the screenshot for name.

If the screenshot doesn't exist, this should be a no-op.

param The value passed to Mugshot.check.

Type declaration:#

▸ (name: string): Promise<void>

Parameters:#

NameType
namestring

Returns: Promise<void>

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:39

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:39


exists#

exists: (name: string) => Promise<boolean>

Check whether a screenshot exists for name.

param The value passed to Mugshot.check.

Type declaration:#

▸ (name: string): Promise<boolean>

Parameters:#

NameType
namestring

Returns: Promise<boolean>

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:22

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:22


read#

read: (name: string) => Promise<Buffer>

Return the screenshot for name as a PNG encoded buffer.

param The value passed to Mugshot.check.

Type declaration:#

▸ (name: string): Promise<Buffer>

Parameters:#

NameType
namestring

Returns: Promise<Buffer>

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:15

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:15


write#

write: (name: string, data: Buffer) => Promise<void>

Write a screenshot for name.

param The value passed to Mugshot.check.

param PNG encoded Buffer.

Type declaration:#

▸ (name: string, data: Buffer): Promise<void>

Parameters:#

NameType
namestring
dataBuffer

Returns: Promise<void>

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:30

Defined in: packages/mugshot/src/interfaces/screenshot-storage.ts:30