UNPKG

@bigfishtv/cockpit

Version:

73 lines (64 loc) 2.03 kB
'use strict'; exports.__esModule = true; exports.init = init; exports.addFileExtension = addFileExtension; exports.addFileExtensions = addFileExtensions; exports.removeFileExtension = removeFileExtension; exports.removeFileExtensions = removeFileExtensions; exports.emptyCategoryExtensions = emptyCategoryExtensions; var _ActionTypes = require('../constants/ActionTypes'); /** * Action to init state * @param {Object} state * @return {Object} returns action */ function init(state) { return { type: _ActionTypes.FILE_EXTENSIONS_INITED, state: state }; } /** * Action to add single file extension * @param {String} category * @param {String} extension * @return {Object} returns action */ /** * @module Actions/fileType */ function addFileExtension(category, extension) { return { type: _ActionTypes.FILE_EXTENSION_ADDED, category: category, extension: extension }; } /** * Action to add multiple file extensions * @param {String} category * @param {String[]} extensions * @return {Object} returns action */ function addFileExtensions(category, extensions) { return { type: _ActionTypes.FILE_EXTENSIONS_ADDED, category: category, extensions: extensions }; } /** * Action to remove single file extension * @param {String} category * @param {String} extension * @return {Object} returns action */ function removeFileExtension(category, extension) { return { type: _ActionTypes.FILE_EXTENSION_REMOVED, category: category, extension: extension }; } /** * Action to remove multiple file extensions * @param {String} category * @param {String[]} extensions * @return {Object} returns action */ function removeFileExtensions(category, extensions) { return { type: _ActionTypes.FILE_EXTENSIONS_REMOVED, category: category, extensions: extensions }; } /** * Action empty all extensions in a fileType category * @param {String} category * @return {Object} returns action */ function emptyCategoryExtensions(category) { return { type: _ActionTypes.FILE_CATEGORY_EMPTIED, category: category }; }