import { Classification } from "./decisions/classification"; import { Decision, DecisionOptions } from "./decisions/decision"; import { Verification } from "./decisions/verification"; import { Tag } from "./tag"; import { Constructor, EnumValue, ObjectRecord } from "../helpers/types/advancedTypes"; import { NewTag } from "./decisions/newTag"; import { OptionalDecision } from "./decisions/decisionNotRequired"; import { SubjectChange } from "verification-grid/verification-grid"; export declare enum AudioCachedState { COLD = 0, REQUESTED = 1, SUCCESS = 2, FAILED = 3 } /** Original unprocessed data from the data source */ export type Subject = ObjectRecord; declare const columnNamespace = "oe_"; export declare const tagColumnName = "oe_tag"; export declare const confirmedColumnName = "oe_confirmed"; export declare const newTagColumnName = "oe_new_tag"; type ClassificationColumn = `${typeof columnNamespace}${string}`; export interface DownloadableResult extends Subject { [tagColumnName]: string; [confirmedColumnName]: EnumValue; [key: ClassificationColumn]: EnumValue; } /** * @constructor * @param {Subject} subject * The original data provided by the data source * * @param {String} url * The url that has been extracted from the original data source * * @param {Tag} tag * The tag that has been extracted from the original data source */ export declare class SubjectWrapper { constructor(subject: Subject, url: string, tag: Tag | null); /** * @description * aka: context * this is the native data model used by the host application * or this could be the csv row * * !the subject object reference must remain the same for the lifetime of * !the application, otherwise downloading results will result in unexpected * !or incorrect output */ subject: Readonly; /** If the audio has been pre-fetched using a GET request */ clientCached: AudioCachedState; /** If the audio has been warmed/split on the server using a HEAD request */ serverCached: AudioCachedState; verification?: OptionalDecision; newTag?: OptionalDecision; classifications: Map; url: string; tag: Tag | null; /** * Adds a decision to the subject and removes any decisions that have been * made against the same tag. * Decisions that are made about the same tag are removed so that it is not * possible to have both a positive and negative decision about a tag */ addDecision(decision: Decision): SubjectChange; /** Removes a decision from the subject */ removeDecision(decision: Decision): SubjectChange; hasOutstandingDecisions(requiresVerification: boolean, requiresNewTag: boolean, requiredClassifications?: Tag[]): boolean; /** * @description * Compares the subjects decisions to an array of required tags and * applies a skip decision to any required tags that do not have a decision * made about them * * @param requiresVerification * Looks at the subject model and applies a skip decision to the * verification task if none is applied * * @param requiredClassifications * Classifications that will be * applied as a skip decision if not present * on the subject * * @returns * An SubjectChange object that describes what changes were made to the * subject as part of this method call. */ skipUndecided(requiresVerification: boolean, requiresNewTag: boolean, requiredClassifications?: Tag[]): SubjectChange; /** * @returns * A SubjectChange object that explicitly states if any decisions were set to * "null" as a result of their decision no longer being required, and * therefore removed. */ setDecisionNotRequired(decision: Constructor): SubjectChange; setDecisionRequired(decision: Constructor): void; /** Checks if the current subject has a decision */ hasDecision(queryingDecision: Decision): boolean; toDownloadable(): Partial; private addVerification; private addClassification; private applyNewTag; private removeVerification; private removeClassification; private removeNewTag; } export {};