import 'server-only'; import Pagination from './helpers/pagination'; import { ImagesAPIMedia, CreateImage } from './image.types'; import Model, { ModelError } from './model'; export * from './image.types'; export default class Image extends Model { static pagination: Pagination | null; /** * This will add an updloaded image asset to the DB * @example * ``` * const res = await ImageModel.create({ imageData: body, siteId: agency.siteId }); * ``` * * Image creation requires a Bearer token (app verification) via production * users api, regardless of environment. * This is handled in the `images-api-client/index.ts` */ static create({ imageData, siteId, }: { imageData: CreateImage | null; siteId: number | null; }): Promise<{ result: { path: string; url: string; homeflow_id: string | undefined; } | null; errors: { message: { status: number; }; }[] | null; } | null>; /** * This will return an array of image objects with the structure: * @example * ```ts * { url: string; alt: string; } * ``` */ static findAll({ page, pageSize, type, name, }: { page?: number; pageSize?: number; type?: string; name?: string; }): Promise<{ results: Image[]; pagination: Pagination | null; errors: ModelError[] | null; }>; get id(): number | null; get name(): string | null; get url(): string | null; get alt(): string | null; } //# sourceMappingURL=image.d.ts.map