From c60d0e7392fc708e961614d6b756a045de74f458 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 30 Apr 2019 14:00:07 +0900 Subject: Rename .js/.jsx to .ts/.tsx --- src/console/actions/console.js | 96 ------------------------------------------ src/console/actions/console.ts | 96 ++++++++++++++++++++++++++++++++++++++++++ src/console/actions/index.js | 13 ------ src/console/actions/index.ts | 13 ++++++ 4 files changed, 109 insertions(+), 109 deletions(-) delete mode 100644 src/console/actions/console.js create mode 100644 src/console/actions/console.ts delete mode 100644 src/console/actions/index.js create mode 100644 src/console/actions/index.ts (limited to 'src/console/actions') diff --git a/src/console/actions/console.js b/src/console/actions/console.js deleted file mode 100644 index 3713a76..0000000 --- a/src/console/actions/console.js +++ /dev/null @@ -1,96 +0,0 @@ -import messages from 'shared/messages'; -import actions from 'console/actions'; - -const hide = () => { - return { - type: actions.CONSOLE_HIDE, - }; -}; - -const showCommand = (text) => { - return { - type: actions.CONSOLE_SHOW_COMMAND, - text: text - }; -}; - -const showFind = () => { - return { - type: actions.CONSOLE_SHOW_FIND, - }; -}; - -const showError = (text) => { - return { - type: actions.CONSOLE_SHOW_ERROR, - text: text - }; -}; - -const showInfo = (text) => { - return { - type: actions.CONSOLE_SHOW_INFO, - text: text - }; -}; - -const hideCommand = () => { - window.top.postMessage(JSON.stringify({ - type: messages.CONSOLE_UNFOCUS, - }), '*'); - return { - type: actions.CONSOLE_HIDE_COMMAND, - }; -}; - -const enterCommand = async(text) => { - await browser.runtime.sendMessage({ - type: messages.CONSOLE_ENTER_COMMAND, - text, - }); - return hideCommand(text); -}; - -const enterFind = (text) => { - window.top.postMessage(JSON.stringify({ - type: messages.CONSOLE_ENTER_FIND, - text, - }), '*'); - return hideCommand(); -}; - -const setConsoleText = (consoleText) => { - return { - type: actions.CONSOLE_SET_CONSOLE_TEXT, - consoleText, - }; -}; - -const getCompletions = async(text) => { - let completions = await browser.runtime.sendMessage({ - type: messages.CONSOLE_QUERY_COMPLETIONS, - text, - }); - return { - type: actions.CONSOLE_SET_COMPLETIONS, - completions, - completionSource: text, - }; -}; - -const completionNext = () => { - return { - type: actions.CONSOLE_COMPLETION_NEXT, - }; -}; - -const completionPrev = () => { - return { - type: actions.CONSOLE_COMPLETION_PREV, - }; -}; - -export { - hide, showCommand, showFind, showError, showInfo, hideCommand, setConsoleText, - enterCommand, enterFind, getCompletions, completionNext, completionPrev -}; diff --git a/src/console/actions/console.ts b/src/console/actions/console.ts new file mode 100644 index 0000000..3713a76 --- /dev/null +++ b/src/console/actions/console.ts @@ -0,0 +1,96 @@ +import messages from 'shared/messages'; +import actions from 'console/actions'; + +const hide = () => { + return { + type: actions.CONSOLE_HIDE, + }; +}; + +const showCommand = (text) => { + return { + type: actions.CONSOLE_SHOW_COMMAND, + text: text + }; +}; + +const showFind = () => { + return { + type: actions.CONSOLE_SHOW_FIND, + }; +}; + +const showError = (text) => { + return { + type: actions.CONSOLE_SHOW_ERROR, + text: text + }; +}; + +const showInfo = (text) => { + return { + type: actions.CONSOLE_SHOW_INFO, + text: text + }; +}; + +const hideCommand = () => { + window.top.postMessage(JSON.stringify({ + type: messages.CONSOLE_UNFOCUS, + }), '*'); + return { + type: actions.CONSOLE_HIDE_COMMAND, + }; +}; + +const enterCommand = async(text) => { + await browser.runtime.sendMessage({ + type: messages.CONSOLE_ENTER_COMMAND, + text, + }); + return hideCommand(text); +}; + +const enterFind = (text) => { + window.top.postMessage(JSON.stringify({ + type: messages.CONSOLE_ENTER_FIND, + text, + }), '*'); + return hideCommand(); +}; + +const setConsoleText = (consoleText) => { + return { + type: actions.CONSOLE_SET_CONSOLE_TEXT, + consoleText, + }; +}; + +const getCompletions = async(text) => { + let completions = await browser.runtime.sendMessage({ + type: messages.CONSOLE_QUERY_COMPLETIONS, + text, + }); + return { + type: actions.CONSOLE_SET_COMPLETIONS, + completions, + completionSource: text, + }; +}; + +const completionNext = () => { + return { + type: actions.CONSOLE_COMPLETION_NEXT, + }; +}; + +const completionPrev = () => { + return { + type: actions.CONSOLE_COMPLETION_PREV, + }; +}; + +export { + hide, showCommand, showFind, showError, showInfo, hideCommand, setConsoleText, + enterCommand, enterFind, getCompletions, completionNext, completionPrev +}; diff --git a/src/console/actions/index.js b/src/console/actions/index.js deleted file mode 100644 index b394179..0000000 --- a/src/console/actions/index.js +++ /dev/null @@ -1,13 +0,0 @@ -export default { - // console commands - CONSOLE_HIDE: 'console.hide', - CONSOLE_SHOW_COMMAND: 'console.show.command', - CONSOLE_SHOW_ERROR: 'console.show.error', - CONSOLE_SHOW_INFO: 'console.show.info', - CONSOLE_HIDE_COMMAND: 'console.hide.command', - CONSOLE_SET_CONSOLE_TEXT: 'console.set.command', - CONSOLE_SET_COMPLETIONS: 'console.set.completions', - CONSOLE_COMPLETION_NEXT: 'console.completion.next', - CONSOLE_COMPLETION_PREV: 'console.completion.prev', - CONSOLE_SHOW_FIND: 'console.show.find', -}; diff --git a/src/console/actions/index.ts b/src/console/actions/index.ts new file mode 100644 index 0000000..b394179 --- /dev/null +++ b/src/console/actions/index.ts @@ -0,0 +1,13 @@ +export default { + // console commands + CONSOLE_HIDE: 'console.hide', + CONSOLE_SHOW_COMMAND: 'console.show.command', + CONSOLE_SHOW_ERROR: 'console.show.error', + CONSOLE_SHOW_INFO: 'console.show.info', + CONSOLE_HIDE_COMMAND: 'console.hide.command', + CONSOLE_SET_CONSOLE_TEXT: 'console.set.command', + CONSOLE_SET_COMPLETIONS: 'console.set.completions', + CONSOLE_COMPLETION_NEXT: 'console.completion.next', + CONSOLE_COMPLETION_PREV: 'console.completion.prev', + CONSOLE_SHOW_FIND: 'console.show.find', +}; -- cgit v1.2.3