import { ExpoWebGLRenderingContext } from "expo-gl"; import { EditingOperations } from "./index"; import { atom } from "recoil"; export interface ImageData { uri: string; height: number; width: number; } export const imageDataState = atom({ key: "imageDataState", default: { uri: "", width: 0, height: 0, }, }); export const imageScaleFactorState = atom({ key: "imageScaleFactorState", default: 1, }); export interface ImageBounds { x: number; y: number; height: number; width: number; } export const imageBoundsState = atom({ key: "imageBoundsState", default: { x: 0, y: 0, width: 0, height: 0, }, }); export const readyState = atom({ key: "readyState", default: false, }); export const processingState = atom({ key: "processingState", default: false, }); export interface AccumulatedPan { x: number; y: number; } export const accumulatedPanState = atom({ key: "accumulatedPanState", default: { x: 0, y: 0, }, }); export interface ImageDimensions { width: number; height: number; } export const cropSizeState = atom({ key: "cropSizeState", default: { width: 0, height: 0, }, }); export type EditingModes = "operation-select" | EditingOperations; export const editingModeState = atom({ key: "editingModeState", default: "operation-select", }); interface GLContext { gl: ExpoWebGLRenderingContext | null; program: WebGLProgram; verts: Float32Array; } export const glContextState = atom({ key: "glContextState", default: null, }); export const glProgramState = atom({ key: "glProgramState", default: null, });