models.d.ts•1.64 kB
import EverArt from '..';
type ModelStatus = 'PENDING' | 'PROCESSING' | 'TRAINING' | 'READY' | 'FAILED' | 'CANCELED';
type ModelSubject = 'OBJECT' | 'STYLE' | 'PERSON';
type Model = {
    id: string;
    name: string;
    status: ModelStatus;
    subject: ModelSubject;
    createdAt: Date;
    updatedAt: Date;
    estimatedCompletedAt?: Date;
    thumbnailUrl?: string;
};
export type FetchManyResponse = {
    models: Model[];
    hasMore: boolean;
};
export type FetchManyOptions = [
    options?: {
        beforeId?: string;
        limit?: number;
        search?: string;
        status?: ModelStatus;
    }
];
/**
 * EverArt List Models (v1/models)
 */
export declare function fetchMany(this: EverArt, ...args: FetchManyOptions): Promise<FetchManyResponse>;
export type FetchResponse = Model;
export type FetchOptions = [id: string];
/**
 * EverArt List Models (v1/models)
 */
export declare function fetch(this: EverArt, ...args: FetchOptions): Promise<FetchResponse>;
export type URLImageInput = {
    type: 'url';
    value: string;
};
export type FileImageInput = {
    type: 'file';
    path: string;
};
export type ImageInput = URLImageInput | FileImageInput;
export type CreateResponse = Model;
export type V1CreateRequiredParams = [
    name: string,
    subject: ModelSubject,
    images: ImageInput[]
];
export type V1CreateOptionalParams = {
    webhookUrl?: string;
};
export type CreateOptions = [
    ...V1CreateRequiredParams,
    options?: V1CreateOptionalParams
];
/**
 * EverArt List Models (v1/models)
 */
export declare function create(this: EverArt, ...args: CreateOptions): Promise<CreateResponse>;
export {};