<commit_before>// tslint:disable:max-line-length
import { Action, makeActionFunction } from "../utils";

// FIXME: probably belongs somewhere else
interface ConfigPayload {
  config: {
    [key: string]: string;
  };
}

export const LOAD_CONFIG            = "LOAD_CONFIG";
export const SAVE_CONFIG            = "SAVE_CONFIG";
export const DONE_SAVING_CONFIG     = "DONE_SAVING_CONFIG";
export const MERGE_CONFIG           = "MERGE_CONFIG";
export const SET_CONFIG_AT_KEY      = "SET_CONFIG_AT_KEY";

export type LoadConfigAction        = Action<typeof LOAD_CONFIG>;
export type SaveConfigAction        = Action<typeof SAVE_CONFIG>;
export type DoneSavingConfigAction  = Action<typeof DONE_SAVING_CONFIG>;
export type MergeConfigAction       = Action<typeof MERGE_CONFIG,         ConfigPayload>;
export type SetConfigAction     <T> = Action<typeof SET_CONFIG_AT_KEY,    { key: string; value: T }>;

export const loadConfig             = makeActionFunction<LoadConfigAction>      (LOAD_CONFIG);
export const saveConfig             = makeActionFunction<SaveConfigAction>      (SAVE_CONFIG);
export const doneSavingConfig       = makeActionFunction<DoneSavingConfigAction>(DONE_SAVING_CONFIG);
export const mergeConfig            = makeActionFunction<MergeConfigAction>     (MERGE_CONFIG);
export const setConfigAtKey         = <T>(key: string, value: T) => makeActionFunction<SetConfigAction<T>>(SET_CONFIG_AT_KEY)({key, value});
export const setTheme               = (theme: string) => setConfigAtKey("theme", theme);
export const setCursorBlink         = (value: string) => setConfigAtKey("cursorBlinkRate", value);<commit_msg>Add missing action<commit_after>// tslint:disable:max-line-length
import { Action, makeActionFunction } from "../utils";

// FIXME: probably belongs somewhere else
interface ConfigPayload {
  config: {
    [key: string]: string;
  };
}

export const LOAD_CONFIG            = "LOAD_CONFIG";
export const CONFIG_LOADED          = "CONFIG_LOADED";
export const SAVE_CONFIG            = "SAVE_CONFIG";
export const DONE_SAVING_CONFIG     = "DONE_SAVING_CONFIG";
export const MERGE_CONFIG           = "MERGE_CONFIG";
export const SET_CONFIG_AT_KEY      = "SET_CONFIG_AT_KEY";

export type LoadConfigAction        = Action<typeof LOAD_CONFIG>;
export type ConfigLoadedAction      = Action<typeof CONFIG_LOADED>;
export type SaveConfigAction        = Action<typeof SAVE_CONFIG>;
export type DoneSavingConfigAction  = Action<typeof DONE_SAVING_CONFIG>;
export type MergeConfigAction       = Action<typeof MERGE_CONFIG,         ConfigPayload>;
export type SetConfigAction     <T> = Action<typeof SET_CONFIG_AT_KEY,    { key: string; value: T }>;

export const loadConfig             = makeActionFunction<LoadConfigAction>      (LOAD_CONFIG);
export const configLoaded           = makeActionFunction<ConfigLoadedAction>    (CONFIG_LOADED);
export const saveConfig             = makeActionFunction<SaveConfigAction>      (SAVE_CONFIG);
export const doneSavingConfig       = makeActionFunction<DoneSavingConfigAction>(DONE_SAVING_CONFIG);
export const mergeConfig            = makeActionFunction<MergeConfigAction>     (MERGE_CONFIG);
export const setConfigAtKey         = <T>(key: string, value: T) => makeActionFunction<SetConfigAction<T>>(SET_CONFIG_AT_KEY)({key, value});
export const setTheme               = (theme: string) => setConfigAtKey("theme", theme);
export const setCursorBlink         = (value: string) => setConfigAtKey("cursorBlinkRate", value);
{'fraction_non_alphanumeric': 0.090882945067587, 'fraction_numerical': 0.0, 'mean_word_length': 4.03328509406657, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '516163', 'n_tokens_mistral': 974, 'n_tokens_neox': 961, 'n_words': 237}