romaine
Version:
React OpenCV Manipulation and Image Narration & Editing
45 lines • 1.59 kB
TypeScript
import React, { FC, ReactNode } from "react";
import { moduleConfig } from "../../util/configs";
import { ClearHistory } from "../../util";
import type { RomaineState, PushHistory, SetCropPoints } from "../../util";
import type { OpenCV } from "../../types/openCV";
declare global {
interface Window {
cv: OpenCV;
Module: typeof moduleConfig;
}
}
export interface RomaineContext {
loaded: boolean;
cv: OpenCV;
romaine: RomaineState & {
clearHistory: ClearHistory;
};
setImage: React.Dispatch<React.SetStateAction<string | File | null>>;
setMode?: (mode: RomaineState["mode"]) => void;
setAngle?: (angle: RomaineState["angle"]) => void;
setScale?: (scale: RomaineState["scale"]) => void;
setCropPoints: SetCropPoints;
pushHistory?: PushHistory;
undo: PushHistory;
redo: PushHistory;
updateImageInformation?: (imageInformation: RomaineState["image"]) => void;
}
declare const OpenCvContext: React.Context<RomaineContext>;
declare const OpenCvConsumer: React.Consumer<RomaineContext>;
export interface ROMAINE {
openCvPath?: string;
onLoad?: (openCv: OpenCV) => void;
children?: ReactNode;
/** Angle to use when rotating images @default 90 */
angle?: number;
}
/**
* a romaine context for use in getting openCV and the canvas ref element
* @todo
* 1) Add ref to provider
* 2) See if nonce is really required here
*/
declare const Romaine: FC<ROMAINE>;
export { OpenCvConsumer, OpenCvContext, Romaine };
//# sourceMappingURL=index.d.ts.map