/** * Label Config Builder * * Flexible, declarative Label Studio configuration generator. * Supports any data type and control combination without hardcoding templates. */ export interface LabelConfigSpec { dataType: 'image' | 'text' | 'audio' | 'video' | 'timeseries' | 'html' | 'hypertext'; dataName?: string; controls: ControlSpec[]; } export interface ControlSpec { type: 'choices' | 'labels' | 'textarea' | 'rating' | 'rectangles' | 'polygon' | 'keypoint' | 'brush'; name: string; toName: string; config: any; } export interface ChoicesConfig { choices: string[]; choice?: 'single' | 'multiple'; required?: boolean; } export interface LabelsConfig { labels: Array<{ value: string; background?: string; hotkey?: string; }>; } export interface RatingConfig { maxRating?: number; icon?: string; size?: 'small' | 'medium' | 'large'; } export declare class LabelConfigBuilder { /** * Build Label Studio XML configuration from specification */ static build(spec: LabelConfigSpec): string; /** * Build data source tag (Image, Text, Audio, etc.) */ private static buildDataTag; /** * Build control tag based on type */ private static buildControlTag; /** * Build Choices control (single or multiple selection) */ private static buildChoices; /** * Build Labels control (for NER, classification, etc.) */ private static buildLabels; /** * Build TextArea control */ private static buildTextArea; /** * Build Rating control */ private static buildRating; /** * Build Rectangle control (bounding boxes) */ private static buildRectangles; /** * Build Polygon control */ private static buildPolygon; /** * Build Keypoint control */ private static buildKeypoint; /** * Build Brush control (semantic segmentation) */ private static buildBrush; /** * Escape XML special characters */ private static escapeXml; } /** * Pre-built template generators for common use cases */ export declare class LabelConfigTemplates { /** * Generate Rank N image classification config * Example: WBM Rank 3 classification */ static imageRankN(ranks: number, classes: string[]): LabelConfigSpec; /** * Simple image classification */ static imageClassification(classes: string[], multiLabel?: boolean): LabelConfigSpec; /** * Text classification (sentiment, intent, etc.) */ static textClassification(classes: string[]): LabelConfigSpec; /** * Named Entity Recognition */ static namedEntityRecognition(labels: Array<{ value: string; background: string; }>): LabelConfigSpec; /** * Object detection (bounding boxes) */ static objectDetection(labels: string[]): LabelConfigSpec; /** * Semantic segmentation */ static semanticSegmentation(labels: string[]): LabelConfigSpec; }