// Type definitions for flickerscope // Project: https://github.com/verysilentco/flickerscope export type Mode = 'auto' | 'play' | 'seek'; export type Label = 'none' | 'slight' | 'visible' | 'strong'; export type Warning = 'FEW_FRAMES' | 'TOO_DARK' | 'CLIPPED' | 'LOW_USABLE_AREA' | 'LOW_FRAME_RATE'; export type ErrorCode = | 'CROSS_ORIGIN' | 'PROTECTED' | 'LOAD_FAILED' | 'NO_FRAMES' | 'PLAYBACK_BLOCKED' | 'ABORTED' | 'BAD_INPUT'; /** Settings of the analysis itself (shared by measure, watch and analyze). */ export interface AnalysisOptions { /** Cells per side of the regional grid. Default 4 (16 cells). */ grid?: number; /** Centered moving-average window for the trend, in seconds. Default 0.3. */ trendWindow?: number; /** Upper percentile used as "max" for Percent Flicker. Default 95. */ hiPercentile?: number; /** Lower percentile used as "min" for Percent Flicker. Default 5. */ loPercentile?: number; /** Area-weighted percentile across cells for the regional value. Default 75. */ cellPercentile?: number; /** Weight of the strongest sustained single-cell flicker in the headline. Default 0.5. */ localWeight?: number; /** 8-bit sRGB code below which a pixel (its brightest channel) is near-black. Default 20. */ darkCode?: number; /** 8-bit sRGB code at or above which a pixel (any channel) is clipped. Default 250. */ clipCode?: number; /** Fraction of a cell's pixels that must carry signal for the cell to be used. Default 0.5. */ minValid?: number; } export interface MeasureOptions extends AnalysisOptions { /** * 'play' samples presented frames while the video plays muted; 'seek' steps * frame by frame. 'auto' (default): 'seek' for File/Blob/URL inputs, 'play' for * a