Skip to content

Commit

Permalink
Improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
man90es committed Feb 9, 2024
1 parent 41f1eb5 commit a483275
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 22 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@babel/core": "^7.23.9",
"@babel/eslint-parser": "^7.23.10",
"@bakaso/fkclient": "^1.5.0",
"@types/node": "^20.11.16",
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/cli-plugin-eslint": "^5.0.8",
"@vue/cli-plugin-pwa": "^5.0.8",
Expand Down
41 changes: 25 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const store = createStore({
threads: {},
},
mutations: {
import(state, backup) {
Object.assign(state, backup)
},

updateBoardList(state, payload) {
state.boardList = payload
},
Expand Down
11 changes: 10 additions & 1 deletion src/stores/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { defineStore } from "pinia"

type State = {
animations: boolean
compactBoardMenu: boolean
debug: boolean
noko: boolean
repliesOnBoardPage: number
theme: "Dark" | "Light"
}

export const useSettingsStore = defineStore("settings", {
state: () => ({
state: (): State => ({
animations: true,
compactBoardMenu: false,
debug: false,
Expand Down
10 changes: 9 additions & 1 deletion src/stores/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { defineStore } from "pinia"

type State = {
email: string | null
expiredAt: string | null
id: string | null
name: string | null
registeredAt: string | null
}

export const useUserStore = defineStore("user", {
state: () => ({
state: (): State => ({
email: null,
expiredAt: null,
id: null,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sourceMap": true,
"baseUrl": ".",
"types": [
"node",
"webpack-env"
],
"paths": {
Expand Down

0 comments on commit a483275

Please sign in to comment.