From efabd590a9b982188cb21ba1484a567edbf9039b Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Mon, 15 Apr 2019 22:24:02 +0900
Subject: [PATCH] refs #850 Add define types for unreadNotification
---
src/constants/unreadNotification/index.d.ts | 13 +++++++++++++
.../index.js} | 0
src/renderer/store/Settings/Timeline.ts | 6 +-----
src/renderer/store/TimelineSpace.ts | 7 +------
src/types/unreadNotification.ts | 5 +++++
5 files changed, 20 insertions(+), 11 deletions(-)
create mode 100644 src/constants/unreadNotification/index.d.ts
rename src/constants/{unreadNotification.js => unreadNotification/index.js} (100%)
create mode 100644 src/types/unreadNotification.ts
diff --git a/src/constants/unreadNotification/index.d.ts b/src/constants/unreadNotification/index.d.ts
new file mode 100644
index 00000000..de786070
--- /dev/null
+++ b/src/constants/unreadNotification/index.d.ts
@@ -0,0 +1,13 @@
+export type UnreadNotificationType = {
+ default: boolean
+}
+
+export type UnreadNotificationList = {
+ Direct: UnreadNotificationType,
+ Local: UnreadNotificationType,
+ Public: UnreadNotificationType
+}
+
+declare var u: UnreadNotificationList
+
+export default u
diff --git a/src/constants/unreadNotification.js b/src/constants/unreadNotification/index.js
similarity index 100%
rename from src/constants/unreadNotification.js
rename to src/constants/unreadNotification/index.js
diff --git a/src/renderer/store/Settings/Timeline.ts b/src/renderer/store/Settings/Timeline.ts
index 67d457c2..d11afcf4 100644
--- a/src/renderer/store/Settings/Timeline.ts
+++ b/src/renderer/store/Settings/Timeline.ts
@@ -2,12 +2,8 @@ import { ipcRenderer } from 'electron'
import unreadSettings from '~/src/constants/unreadNotification'
import { Module, MutationTree, ActionTree } from 'vuex'
import { RootState } from '@/store'
+import { UnreadNotification } from '~/src/types/unreadNotification'
-interface UnreadNotification {
- direct: boolean,
- local: boolean,
- public: boolean
-}
export interface TimelineState {
unreadNotification: UnreadNotification
diff --git a/src/renderer/store/TimelineSpace.ts b/src/renderer/store/TimelineSpace.ts
index cca7c3ef..fceb4747 100644
--- a/src/renderer/store/TimelineSpace.ts
+++ b/src/renderer/store/TimelineSpace.ts
@@ -11,6 +11,7 @@ import { Module, MutationTree, ActionTree } from 'vuex'
import LocalAccount from '~/src/types/localAccount'
import { Notify } from './App'
import { RootState } from '@/store'
+import { UnreadNotification } from '~/src/types/unreadNotification'
declare var Notification: any
@@ -19,12 +20,6 @@ interface MyEmoji {
image: string
}
-interface UnreadNotification {
- direct: boolean,
- local: boolean,
- public: boolean
-}
-
export interface TimelineSpaceState {
account: LocalAccount,
loading: boolean,
diff --git a/src/types/unreadNotification.ts b/src/types/unreadNotification.ts
new file mode 100644
index 00000000..b1861521
--- /dev/null
+++ b/src/types/unreadNotification.ts
@@ -0,0 +1,5 @@
+export type UnreadNotification = {
+ direct: boolean,
+ local: boolean,
+ public: boolean
+}