@searcly/sdk
Version:
Searcly Visual Search SDK for JavaScript
71 lines (65 loc) • 1.25 kB
text/typescript
export interface SearclyConfig {
apiKey: string;
baseUrl?: string;
}
export interface ImageAnalysisOptions {
detectObjects?: boolean;
detectColors?: boolean;
detectStyles?: boolean;
detectText?: boolean;
}
export interface SearchOptions {
limit?: number;
offset?: number;
filters?: {
category?: string[];
color?: string[];
style?: string[];
priceRange?: {
min?: number;
max?: number;
};
};
}
export interface AnalysisResult {
objects: Array<{
label: string;
confidence: number;
bbox: [number, number, number, number];
}>;
colors: Array<{
color: string;
hex: string;
percentage: number;
}>;
styles: Array<{
style: string;
confidence: number;
}>;
text: Array<{
text: string;
confidence: number;
bbox: [number, number, number, number];
}>;
}
export interface SearchResult {
id: string;
score: number;
metadata: {
title: string;
description?: string;
price?: number;
currency?: string;
imageUrl: string;
productUrl: string;
brand?: string;
category?: string[];
};
}
export interface BulkAnalysisRequest {
images: Array<{
id: string;
url: string;
options?: ImageAnalysisOptions;
}>;
}