@labelu/image-annotator-react
Version:
image annotator for react
31 lines • 1.35 kB
TypeScript
import type { ToolName, Annotator as ImageAnnotator, EditType } from '@labelu/image';
import type { EnumerableAttribute, TextAttribute, ILabel, Attribute } from '@labelu/interface';
import type { RefObject } from 'react';
import type { ImageAnnotatorOptions } from '../hooks/useImageAnnotator';
export interface GlobalToolConfig {
tag?: EnumerableAttribute[];
text?: TextAttribute[];
}
export interface ToolContextType {
engine: ImageAnnotator;
currentTool: ToolName | undefined;
memorizeToolLabel: RefObject<Record<ToolName, Attribute>>;
config?: ImageAnnotatorOptions;
tools: ToolName[];
selectedLabel: ILabel | undefined;
onLabelChange: (label: ILabel) => void;
globalToolConfig: GlobalToolConfig;
labelMapping: Record<ToolName, Record<string, ILabel>>;
requestEdit?: (type: EditType, payload: {
toolName: ToolName;
label?: string;
modifiedProperty?: string;
}) => boolean;
preLabelMapping: Record<ToolName | 'text' | 'tag', Record<string, ILabel | TextAttribute | EnumerableAttribute>>;
labels: ILabel[];
attributeModalOpen?: boolean;
setAttributeModalOpen: (open: boolean) => void;
}
export declare const ToolContext: import("react").Context<ToolContextType>;
export declare function useTool(): ToolContextType;
//# sourceMappingURL=tool.context.d.ts.map