box-ui-elements-mlh
Version:
59 lines (57 loc) • 1.63 kB
Flow
/**
* Flowtype definitions for types.ts
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.10.0
*/
import { match } from "react-router-dom";
declare export var CREATE: "create";
declare export var Action: {|
+CREATE_START: "create_start", // "create_start"
+CREATE_END: "create_end" // "create_end"
|};
export interface Annotator {
addListener: (
event: string | Symbol,
listener: (...args: any[]) => void
) => void;
emit: (event: string | Symbol, ...args: any[]) => void;
removeAllListeners: () => void;
removeListener: (
event: string | Symbol,
listener: (...args: any[]) => void
) => void;
}
export interface AnnotatorState {
activeAnnotationId?: string | null;
annotation?: { [key: string]: any } | null;
action?: $Values<typeof Action> | null;
error?: Error | null;
meta?: Metadata | null;
}
export type GetMatchPath = (history: History) => match<MatchParams> | null;
export interface AnnotatorContext {
emitActiveChangeEvent: (id: string) => void;
emitRemoveEvent: (id: string) => void;
getAnnotationsMatchPath: GetMatchPath;
getAnnotationsPath: (fileVersionId?: string, annotationId?: string) => string;
state: AnnotatorState;
}
declare export var Status: {|
+ERROR: "error", // "error"
+PENDING: "pending", // "pending"
+SUCCESS: "success" // "success"
|};
export type MatchParams = {
annotationId?: string,
fileVersionId?: string,
...
};
export interface Metadata {
requestId: string;
status: $Values<typeof Status>;
}
export interface AnnotationActionEvent {
annotation?: { [key: string]: any };
error?: Error;
meta: Metadata;
}