import { FeatureID, Json, LabelTypes, SchemaID } from './../types'; import { AssetMetadata } from '../get-next-row'; export declare enum Mode { Reviewing = "Reviewing", Labeling = "Labeling" } export interface User { id: string; name: string | null; email: string; organizationId: string; } export interface LabelTemplateGeneric { id: string; label: string; } export interface LabelTemplateDB { id: string; sourceLabel: { id: string; label: string; }; } export interface Asset { id: string; data: string; datarowId: string; fetchedAt: number; label?: string; labelBeingSaved?: boolean; labelId?: string; nextLabelId?: string; previousLabelId?: string; createdAt?: string; createdBy?: string; typeName?: LabelTypes; labelTemplateId?: string; labelTemplates?: LabelTemplateGeneric[] | null; externalId: string | null; metadata?: AssetMetadata[]; template: LabelTemplateDB | null; logId: string | null; labelingTaskId: string; hidden: boolean | null; } export interface ExposedAsset { id: string; data: string; dataRowId: string; label?: string; previous?: string; next?: string; createdAt?: string; createdBy?: string; typeName?: string; labelTemplateId?: string; labelTemplates?: LabelTemplateGeneric[]; externalId: string | null; metadata?: AssetMetadata[]; template: LabelTemplateDB | null; logId: string | null; labelingTaskId: string; hidden: boolean | null; } interface CurrentAssetInfo { id: string; startTime: number; } export interface ObjectAnnotation { id: FeatureID; schemaId: SchemaID; content: Json; deleted: boolean; } export interface OptionAnnotation { id: FeatureID; schemaId: SchemaID; content: Json; deleted: Boolean; } export interface QuestionAnnotation { id: FeatureID; schemaId: SchemaID; content: Json; deleted: boolean; parentId?: FeatureID; options: OptionAnnotation[]; } export interface CurrentAnnotations { objects: { [id: FeatureID]: ObjectAnnotation; }; questions: { [id: FeatureID]: QuestionAnnotation; }; } export interface AppState { projectId?: string; customizationOptions?: null | undefined | Object; preloading: boolean; token?: string; currentAsset: CurrentAssetInfo | undefined; currentAssetHistory: CurrentAssetInfo[]; assets: { [assetId: string]: Asset; }; fetchingAssetId?: string; user?: User; error: { [key: string]: string; } | null; mode: Mode; currentAnnotations: CurrentAnnotations; } export declare enum ACTION_NAMES { SET_MODE = "SET_MODE", LABEL_SUBMITTED = "LABEL_SUBMITTED", ASSET_FETCHED = "ASSET_FETCHED_SUCCESSFULLY", STARTED_FETCHING_ASSET = "STARTED_FETCHING_ASSET", ASSET_FETCH_FAILED = "ASSET_FETCH_FAILED", APPLICATION_INIT = "APPLICATION_INIT", USER_FETCHED_FROM_SERVER = "USER_FETCHED_FROM_SERVER", USER_CREATED_LABEL = "USER_CREATED_LABEL", LABEL_SAVE_SUCCESS = "LABEL_SAVE_SUCCESS", USER_REQUESTED_PREVIOUS_LABEL = "USER_REQUESTED_PREVIOUS_LABEL", USER_REQUESTED_NEXT_LABEL = "USER_REQUESTED_NEXT_LABEL", LABEL_HISTORY_FETCHED = "LABEL_HISTORY_FETCHED", SET_LABEL_AS_CURRENT_ASSET = "SET_LABEL_AS_CURRENT_ASSET", NO_MORE_ITEMS_TO_LABEL = "NO_MORE_ITEMS_TO_LABEL", SET_LAST_CURRENT_ASSET = "SET_LAST_CURRENT_ASSET", USER_REQUESTED_NEXT_UNLABELED_ASSET = "USER_REQUESTED_NEXT_UNLABELED_ASSET", ASSET_PRELOADED = "ASSET_PRELOADED", FETCH_ASSET = "FETCH_ASSET", STATE_INVALID_FOR_LABELING = "STATE_INVALID_FOR_LABELING", FAILED_TO_SAVE_LABEL = "FAILED_TO_SAVE_LABEL", FAILED_TO_EXTEND_RESERVATIONS = "FAILED_TO_EXTEND_RESERVATIONS", RESERVATIONS_EXTENDED = "RESERVATIONS_EXTENDED", UPDATE_CUSTOMIZATION_OPTIONS = "UPDATE_CUSTOMIZATION_OPTIONS", ASSET_MARKED_AS_LABELED = "ASSET_MARKED_AS_LABELED", OBJECT_ANNOTATION_STAGED = "OBJECT_ANNOTATION_STAGED", QUESTION_ANNOTATION_STAGED = "QUESTION_ANNOTATION_STAGED", ANNOTATIONS_SUBMITTED = "ANNOTATIONS_SUBMITTED", ANNOTATIONS_SUBMIT_SUCCESS = "ANNOTATIONS_SUBMIT_SUCCESS" } export declare function reducer(state?: AppState, action?: Action): AppState; export declare const appInit: ({ projectId, token, labelId, }: { projectId?: string | undefined; token: string | null; labelId?: string | undefined; }) => { type: ACTION_NAMES; payload: { projectId: string | undefined; token: string | null; labelId: string | undefined; }; }; export declare const setMode: (mode: Mode) => { type: ACTION_NAMES; payload: { mode: Mode; }; }; export declare const assetFetched: (asset: Asset, current?: boolean) => { type: ACTION_NAMES; payload: { startTime?: number | undefined; asset: Asset; current: boolean; }; }; export declare const startedFetchingAsset: (labelId?: string) => { type: ACTION_NAMES; payload: string | undefined; }; export declare const assetFetchFailed: (labelId?: string) => { type: ACTION_NAMES; payload: string | undefined; }; export declare const userFetchedFromServer: (user: User) => { type: ACTION_NAMES; payload: { user: User; }; }; export declare const userRequestNextUnlabeledAsset: () => { type: ACTION_NAMES; payload: {}; }; export interface SubmitLabelParam { id: string; assetId: string; projectId: string; rowId: string; label: string; user: User; secondsToLabel: number; typeName: string; templateId?: string | null; } export declare const userCreatedLabel: (createLabel: SubmitLabelParam) => { type: ACTION_NAMES; payload: { id: string; assetId: string; projectId: string; rowId: string; label: string; user: User; secondsToLabel: number; typeName: string; templateId?: string | null | undefined; }; }; export declare const failedToExtendReservations: () => { type: ACTION_NAMES; payload: {}; }; export declare const reservationsExtended: () => { type: ACTION_NAMES; payload: {}; }; export declare const setCustomizationOptions: (customizationOptions: null | undefined | Object) => { type: ACTION_NAMES; payload: { customizationOptions: Object | null | undefined; }; }; export declare const labelChangeSuccess: (assetId: string, label: string, labelId: string, typeName: string, createdAt: string) => { type: ACTION_NAMES; payload: { assetId: string; label: string; labelId: string; typeName: string; createdAt: string; }; }; export declare const setLabelAsCurrentAsset: (labelId: string) => { type: ACTION_NAMES; payload: { labelId: string; }; }; export declare const labelHistorySuccessfullyFetchedForAsset: (assetId: string, previousId?: string | null, nextId?: string | null) => { type: ACTION_NAMES; payload: { assetId: string; previousId: string | null | undefined; nextId: string | null | undefined; }; }; export declare const noMoreItemsToLabel: () => { type: ACTION_NAMES; payload: {}; }; export declare const assetPreloaded: (assetId: string) => { type: ACTION_NAMES; payload: { assetId: string; }; }; export declare const fetchAsset: ({ setAsCurrent }: { setAsCurrent: boolean; }) => { type: ACTION_NAMES; payload: { setAsCurrent: boolean; }; }; export interface LabelSubmittedPayload { label: string; typeName?: LabelTypes; templateId?: string | null; } export declare const labelSubmitted: (payload: LabelSubmittedPayload) => { type: ACTION_NAMES; payload: LabelSubmittedPayload; }; export declare type Action = { type: ACTION_NAMES; payload: any; }; export declare const createLabel: ({ id, assetId, label, rowId, projectId, user, secondsToLabel, typeName, }?: { id?: string | undefined; assetId?: string | undefined; label?: string | undefined; rowId?: string | undefined; projectId?: string | undefined; user?: User | undefined; secondsToLabel?: number | undefined; typeName?: string | undefined; }) => SubmitLabelParam; export declare const createAsset: ({ id, datarowId, externalId, data, label, labelBeingSaved, fetchedAt, labelId, typeName, template, logId, labelingTaskId, hidden, }?: Partial) => Asset; export declare const createUser: ({ id, name, email, organizationId, }?: { id?: string | undefined; name?: null | undefined; email?: string | undefined; organizationId?: string | undefined; }) => User; export declare const createInitPayload: ({ projectId, token, labelId, }?: { projectId?: string | undefined; token?: string | undefined; labelId?: undefined; }) => { projectId: string; token: string; labelId: undefined; }; export declare type AssetMarkedPayload = { label: string; labelId: string; typeName: LabelTypes; }; export declare const assetMarkedAsLabeled: (payload: AssetMarkedPayload) => { type: ACTION_NAMES; payload: AssetMarkedPayload; }; export declare const objectAnnotationStaged: (objectAnnotation: ObjectAnnotation) => { type: ACTION_NAMES; payload: { id: string; object: ObjectAnnotation; }; }; export declare const questionAnnotationStaged: (questionAnnotation: QuestionAnnotation) => { type: ACTION_NAMES; payload: { id: string; question: QuestionAnnotation; }; }; export declare const annotationsSubmitted: (payload: {}) => { type: ACTION_NAMES; payload: {}; }; export declare const annotationsSubmitSuccess: (payload: { assetId: string; labelId: string; }) => { type: ACTION_NAMES; payload: { assetId: string; labelId: string; }; }; export {};