import { AbstractAnalysis, Instance, PlaybackSpeeds, ThermalFileFailure } from "@labir/core"; import { createContext } from "@lit/context"; import { FileMarker } from "../../../controls/file/markers/ImageMarker"; import { AbstractFileProvider } from "../../abstraction/AbstractFileProvider"; type FileContext = Instance; export const fileContext = createContext( "file" ); type FailureContext = ThermalFileFailure; export const FailureContext = createContext( "failure" ); type LoadingContext = boolean; export const loadingContext = createContext( "file-loading" ); type LoadedContext = boolean; export const loadedContext = createContext( "file-loaded" ); export type FileProviderContext = AbstractFileProvider; export const fileProviderContext = createContext( "file-provider-element" ); export type FileMsContext = number; export const fileMsContext = createContext("file-ms-context"); export type FileCursorContext = undefined | { absolute: number, ms: number, percentage: number } export const fileCursorContext = createContext( "file-cursor" ); export type FileCursorSetterContext = (percent: number|undefined) => void; export const fileCursorSetterContext = createContext( "file-cursor-setter" ); export type CurrentFrameContext = { index: number, ms: number, time: string, percentage: number, absolute: number } export const currentFrameContext = createContext( "playback" ); export type DurationContext = { ms: number, time: string } export const durationContext = createContext( "duration" ); type PlayingContext = boolean; export const playingContext = createContext( "playing" ); type PlaybackSpeedContext = PlaybackSpeeds | undefined; export const playbackSpeedContext = createContext( "playbackSpeed" ); type RecordingContext = boolean; export const recordingContext = createContext( "recording" ); type MayStopContext = boolean; export const mayStopContext = createContext( "mayStop" ); export type AnalysisList = AbstractAnalysis[]; export const analysisList = createContext( "analysislist" ); type FileMarkersContext = FileMarker[]; export const fileMarkersContext = createContext( "file-markers-context" );