Skip to content

ImgProcDataAdapter

Data adapter

Properties

close()

close: () => void | Promise<void>

Close database

Returns

void | Promise<void>

Defined in

src/types.ts:713


countdown()

countdown: () => void | Promise<void>

Countdown all records

Returns

void | Promise<void>

Defined in

src/types.ts:703


delete()

delete: (criteria) => void | Promise<void>

Delete the record

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

void | Promise<void>

Defined in

src/types.ts:699


deleteExpiredRecords()

deleteExpiredRecords: (now) => null | Promise<null> | Set<string> | Promise<Set<string>>

Parameters

now: number

Unixtime (milliseconds)

Returns

null | Promise<null> | Set<string> | Promise<Set<string>>

Deleted hashes or null

Defined in

src/types.ts:709


fetch()

fetch: (criteria) => null | ImgProcFileRecord | Promise<ImgProcFileRecord> | Promise<null>

Fetch single record

  • To fetch a record with category source, specify hash.
  • To fetch a record with category variant or placeholder, specify source and profile.

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

null | ImgProcFileRecord | Promise<ImgProcFileRecord> | Promise<null>

Defined in

src/types.ts:680


initialize()

initialize: (options) => void | Promise<void>

Initialize database

Parameters

options: ImgProcDataAdapterInitOptions

Returns

void | Promise<void>

Defined in

src/types.ts:674


insert()

insert: (data) => void | Promise<void>

Insert the record

Parameters

data: ImgProcFile

Returns

void | Promise<void>

Defined in

src/types.ts:686


list()

list: () => Set<string> | Promise<Set<string>>

List all hashes

Returns

Set<string> | Promise<Set<string>>

Defined in

src/types.ts:684


renew()

renew: (criteria) => void | Promise<void>

Renew the record

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

void | Promise<void>

Defined in

src/types.ts:701


updateMetadata()

updateMetadata: (data) => void | Promise<void>

Update the record for remote file

Parameters

data

data.b?: number

data.expiresAt?: number

data.format: string

data.g?: number

data.hash: string

data.height: number

data.r?: number

data.width: number

Returns

void | Promise<void>

Defined in

src/types.ts:688