Types src/content
This commit is contained in:
parent
992b3ac65d
commit
d01db82c0d
62 changed files with 1411 additions and 468 deletions
|
@ -1,31 +1,120 @@
|
|||
export default {
|
||||
// Enable/disable
|
||||
ADDON_SET_ENABLED: 'addon.set.enabled',
|
||||
import Redux from 'redux';
|
||||
|
||||
// Settings
|
||||
SETTING_SET: 'setting.set',
|
||||
// Enable/disable
|
||||
export const ADDON_SET_ENABLED = 'addon.set.enabled';
|
||||
|
||||
// User input
|
||||
INPUT_KEY_PRESS: 'input.key.press',
|
||||
INPUT_CLEAR_KEYS: 'input.clear.keys',
|
||||
// Find
|
||||
export const FIND_SET_KEYWORD = 'find.set.keyword';
|
||||
|
||||
// Completion
|
||||
COMPLETION_SET_ITEMS: 'completion.set.items',
|
||||
COMPLETION_SELECT_NEXT: 'completions.select.next',
|
||||
COMPLETION_SELECT_PREV: 'completions.select.prev',
|
||||
// Settings
|
||||
export const SETTING_SET = 'setting.set';
|
||||
|
||||
// Follow
|
||||
FOLLOW_CONTROLLER_ENABLE: 'follow.controller.enable',
|
||||
FOLLOW_CONTROLLER_DISABLE: 'follow.controller.disable',
|
||||
FOLLOW_CONTROLLER_KEY_PRESS: 'follow.controller.key.press',
|
||||
FOLLOW_CONTROLLER_BACKSPACE: 'follow.controller.backspace',
|
||||
// User input
|
||||
export const INPUT_KEY_PRESS = 'input.key.press';
|
||||
export const INPUT_CLEAR_KEYS = 'input.clear.keys';
|
||||
|
||||
// Find
|
||||
FIND_SET_KEYWORD: 'find.set.keyword',
|
||||
// Completion
|
||||
export const COMPLETION_SET_ITEMS = 'completion.set.items';
|
||||
export const COMPLETION_SELECT_NEXT = 'completions.select.next';
|
||||
export const COMPLETION_SELECT_PREV = 'completions.select.prev';
|
||||
|
||||
// Mark
|
||||
MARK_START_SET: 'mark.start.set',
|
||||
MARK_START_JUMP: 'mark.start.jump',
|
||||
MARK_CANCEL: 'mark.cancel',
|
||||
MARK_SET_LOCAL: 'mark.set.local',
|
||||
};
|
||||
// Follow
|
||||
export const FOLLOW_CONTROLLER_ENABLE = 'follow.controller.enable';
|
||||
export const FOLLOW_CONTROLLER_DISABLE = 'follow.controller.disable';
|
||||
export const FOLLOW_CONTROLLER_KEY_PRESS = 'follow.controller.key.press';
|
||||
export const FOLLOW_CONTROLLER_BACKSPACE = 'follow.controller.backspace';
|
||||
|
||||
// Mark
|
||||
export const MARK_START_SET = 'mark.start.set';
|
||||
export const MARK_START_JUMP = 'mark.start.jump';
|
||||
export const MARK_CANCEL = 'mark.cancel';
|
||||
export const MARK_SET_LOCAL = 'mark.set.local';
|
||||
|
||||
export const NOOP = 'noop';
|
||||
|
||||
export interface AddonSetEnabledAction extends Redux.Action {
|
||||
type: typeof ADDON_SET_ENABLED;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface FindSetKeywordAction extends Redux.Action {
|
||||
type: typeof FIND_SET_KEYWORD;
|
||||
keyword: string;
|
||||
found: boolean;
|
||||
}
|
||||
|
||||
export interface SettingSetAction extends Redux.Action {
|
||||
type: typeof SETTING_SET;
|
||||
value: any;
|
||||
}
|
||||
|
||||
export interface InputKeyPressAction extends Redux.Action {
|
||||
type: typeof INPUT_KEY_PRESS;
|
||||
key: string;
|
||||
}
|
||||
|
||||
export interface InputClearKeysAction extends Redux.Action {
|
||||
type: typeof INPUT_CLEAR_KEYS;
|
||||
}
|
||||
|
||||
export interface FollowControllerEnableAction extends Redux.Action {
|
||||
type: typeof FOLLOW_CONTROLLER_ENABLE;
|
||||
newTab: boolean;
|
||||
background: boolean;
|
||||
}
|
||||
|
||||
export interface FollowControllerDisableAction extends Redux.Action {
|
||||
type: typeof FOLLOW_CONTROLLER_DISABLE;
|
||||
}
|
||||
|
||||
export interface FollowControllerKeyPressAction extends Redux.Action {
|
||||
type: typeof FOLLOW_CONTROLLER_KEY_PRESS;
|
||||
key: string;
|
||||
}
|
||||
|
||||
export interface FollowControllerBackspaceAction extends Redux.Action {
|
||||
type: typeof FOLLOW_CONTROLLER_BACKSPACE;
|
||||
}
|
||||
|
||||
export interface MarkStartSetAction extends Redux.Action {
|
||||
type: typeof MARK_START_SET;
|
||||
}
|
||||
|
||||
export interface MarkStartJumpAction extends Redux.Action {
|
||||
type: typeof MARK_START_JUMP;
|
||||
}
|
||||
|
||||
export interface MarkCancelAction extends Redux.Action {
|
||||
type: typeof MARK_CANCEL;
|
||||
}
|
||||
|
||||
export interface MarkSetLocalAction extends Redux.Action {
|
||||
type: typeof MARK_SET_LOCAL;
|
||||
key: string;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface NoopAction extends Redux.Action {
|
||||
type: typeof NOOP;
|
||||
}
|
||||
|
||||
export type AddonAction = AddonSetEnabledAction;
|
||||
export type FindAction = FindSetKeywordAction | NoopAction;
|
||||
export type SettingAction = SettingSetAction;
|
||||
export type InputAction = InputKeyPressAction | InputClearKeysAction;
|
||||
export type FollowAction =
|
||||
FollowControllerEnableAction | FollowControllerDisableAction |
|
||||
FollowControllerKeyPressAction | FollowControllerBackspaceAction;
|
||||
export type MarkAction =
|
||||
MarkStartSetAction | MarkStartJumpAction |
|
||||
MarkCancelAction | MarkSetLocalAction | NoopAction;
|
||||
|
||||
export type Action =
|
||||
AddonAction |
|
||||
FindAction |
|
||||
SettingAction |
|
||||
InputAction |
|
||||
FollowAction |
|
||||
MarkAction |
|
||||
NoopAction;
|
||||
|
|
Reference in a new issue