From 5e4ca8ef837e4fdb91dfacd5b7f72d473759a178 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 16 Dec 2018 18:57:34 -0800 Subject: [PATCH] Cleanup socketio stuff for typescript --- package.json | 3 +- .../scripts/components/server/Server.vue | 2 +- .../server/components/PowerButtons.vue | 2 +- .../filemanager/FileManagerFileRow.vue | 2 +- .../filemanager/FileManagerFolderRow.vue | 2 +- .../components/server/subpages/Console.vue | 2 +- .../scripts/helpers/{axios.js => axios.ts} | 9 +- .../scripts/helpers/{index.js => index.ts} | 16 +-- .../scripts/mixins/{flash.js => flash.ts} | 26 ++-- .../scripts/mixins/socketio/connector.js | 103 ---------------- .../scripts/mixins/socketio/connector.ts | 115 ++++++++++++++++++ .../socketio/{emitter.js => emitter.ts} | 32 +++-- .../mixins/socketio/{index.js => index.ts} | 19 ++- resources/assets/scripts/store/index.ts | 18 +-- .../assets/scripts/store/modules/auth.ts | 7 +- .../assets/scripts/store/modules/dashboard.ts | 6 +- .../assets/scripts/store/modules/server.ts | 12 +- .../assets/scripts/store/modules/socket.ts | 7 +- resources/assets/scripts/store/types.ts | 37 ++++++ resources/assets/scripts/vue-shims.d.ts | 21 +++- tsconfig.json | 3 +- yarn.lock | 12 +- 22 files changed, 246 insertions(+), 210 deletions(-) rename resources/assets/scripts/helpers/{axios.js => axios.ts} (68%) rename resources/assets/scripts/helpers/{index.js => index.ts} (64%) rename resources/assets/scripts/mixins/{flash.js => flash.ts} (68%) delete mode 100644 resources/assets/scripts/mixins/socketio/connector.js create mode 100644 resources/assets/scripts/mixins/socketio/connector.ts rename resources/assets/scripts/mixins/socketio/{emitter.js => emitter.ts} (62%) rename resources/assets/scripts/mixins/socketio/{index.js => index.ts} (73%) create mode 100644 resources/assets/scripts/store/types.ts diff --git a/package.json b/package.json index 687ffef62..05dd9cc49 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,9 @@ "@babel/plugin-transform-async-to-generator": "^7.0.0-beta.49", "@babel/plugin-transform-runtime": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49", + "@types/lodash": "^4.14.119", "@types/node": "^10.12.15", + "@types/socket.io-client": "^1.4.32", "@types/webpack-env": "^1.13.6", "autoprefixer": "^8.2.0", "axios": "^0.18.0", @@ -33,7 +35,6 @@ "babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-strict-mode": "^6.18.0", "babel-register": "^6.26.0", - "camelcase": "^5.0.0", "clean-webpack-plugin": "^0.1.19", "css-loader": "^0.28.11", "eslint": "^5.6.0", diff --git a/resources/assets/scripts/components/server/Server.vue b/resources/assets/scripts/components/server/Server.vue index 91b33e128..1bde1194f 100644 --- a/resources/assets/scripts/components/server/Server.vue +++ b/resources/assets/scripts/components/server/Server.vue @@ -69,7 +69,7 @@ import ProgressBar from './components/ProgressBar'; import { mapState } from 'vuex'; import io from 'socket.io-client'; - import { Socketio } from './../../mixins/socketio'; + import { Socketio } from '../../mixins/socketio/index'; import PowerButtons from './components/PowerButtons'; import Flash from '../Flash'; diff --git a/resources/assets/scripts/components/server/components/PowerButtons.vue b/resources/assets/scripts/components/server/components/PowerButtons.vue index 00cb7251e..990b179a0 100644 --- a/resources/assets/scripts/components/server/components/PowerButtons.vue +++ b/resources/assets/scripts/components/server/components/PowerButtons.vue @@ -24,7 +24,7 @@