jedifocus.navigations
Version:
Columns of JediFocus.
113 lines (103 loc) • 2.93 kB
JavaScript
/* __.-._
* '-._"7' JediFocus
* /'.-c
* | /T Do. Or do not.
* _)_/LI There is no try.
*
* This project is a part of the “Byte-Sized JavaScript” videocasts.
* You can watch “Byte-Sized JavaScript” at: https://bytesized.tv/
*
* MIT Licensed — See LICENSE.md
*
* Send your comments, suggestions, and feedback to me@volkan.io
*/
declare module 'jedi-types' {
declare type JackDaniels = number;
}
declare module 'jedifocus-card-types' {
declare type MoveFunction = (
id: string,
userId: string,
column: string,
description: string,
context: string,
invert?: boolean
) => void;
declare type Dispatcher = ({ type: string, payload: {} }) => void;
declare type CardProps = {
description: string,
column: string,
id: string,
userId: string,
context: string,
passive: boolean,
contextMenuVisible: boolean,
contextMenuCardId: string,
modalId: string,
editCard: (column: string, id: string) => void,
moveCardToToDo: MoveFunction,
moveCardToInProgress: MoveFunction,
moveCardToBestIntentions: MoveFunction,
moveCardToDone: MoveFunction,
showAdvancedCardActions: (
id: string,
column: string,
context: string
) => void
};
declare type CardAdvancedActionProps = {
column: string,
context: string,
id: string,
userId: string,
description: string,
moveCardToToDo: MoveFunction,
moveCardToInProgress: MoveFunction,
moveCardToBestIntentions: MoveFunction,
moveCardToDone: MoveFunction
};
declare type CardClickPayload = {
column: string,
id: string,
editCard: (column: string, id: string) => void
};
declare type MoveCardClickPayload = {
column: string,
description: string,
id: string,
userId: string,
context: string,
moveCardToToDo?: MoveFunction,
moveCardToInProgress?: MoveFunction,
moveCardToBestIntentions?: MoveFunction,
moveCardToDone?: MoveFunction
};
declare type AdvancedCardActionsPayload = {
id: string,
column: string,
context: string,
showAdvancedCardActions: (
id: string,
column: string,
context: string
) => void
};
// I had to copy this over from flow’s source code; I don’t know why!
declare class SyntheticEvent<+T: EventTarget = EventTarget> {
bubbles: boolean;
cancelable: boolean;
+currentTarget: T;
defaultPrevented: boolean;
eventPhase: number;
isDefaultPrevented(): boolean;
isPropagationStopped(): boolean;
isTrusted: boolean;
nativeEvent: Event;
preventDefault(): void;
stopPropagation(): void;
+target: EventTarget;
timeStamp: number;
type: string;
persist(): void;
}
}