Skip to content

Commit 09a2d39

Browse files
committed
fix: using proper typescript types
1 parent 3beb8e3 commit 09a2d39

File tree

3 files changed

+65
-5
lines changed

3 files changed

+65
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ For detailed explanation on how things work, check out the [documentation](https
6868
- [x] Fix toast issue. (Click on copy button while toast is on)
6969
- [ ] Handle line gutter issue when last line in data is empty
7070
- [ ] Handle consecutive empty lines in input should be preserved in output
71+
- [ ] Add css for selection pseudo class

pages/index.vue

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,47 @@
1212
<div class="flex flex-wrap w-full h-full gap-4">
1313
<textarea
1414
id="lhs"
15-
class="flex-1 h-full max-h-full bg-transparent rounded-md resize-none form-textarea"
15+
class="
16+
flex-1
17+
h-full
18+
max-h-full
19+
bg-transparent
20+
rounded-md
21+
resize-none
22+
form-textarea
23+
"
1624
></textarea>
1725
<textarea
1826
id="rhs"
19-
class="flex-1 h-full max-h-full bg-transparent rounded-md resize-none form-textarea"
27+
class="
28+
flex-1
29+
h-full
30+
max-h-full
31+
bg-transparent
32+
rounded-md
33+
resize-none
34+
form-textarea
35+
"
2036
></textarea>
2137
<div class="self-end flex-grow-0 w-full text-center">
2238
<button
23-
class="inline-flex items-center justify-center w-48 px-4 py-2 transition-transform transform bg-blue-600 rounded-md shadow-lg outline-none text-gray-50 focus:ring-4 active:scale-y-75"
39+
class="
40+
inline-flex
41+
items-center
42+
justify-center
43+
w-48
44+
px-4
45+
py-2
46+
transition-transform
47+
transform
48+
bg-blue-600
49+
rounded-md
50+
shadow-lg
51+
outline-none
52+
text-gray-50
53+
focus:ring-4
54+
active:scale-y-75
55+
"
2456
>
2557
Compare
2658
</button>
@@ -40,7 +72,7 @@ const dmp = new DiffMatchPatch()
4072
export default Vue.extend({
4173
layout: 'main',
4274
methods: {
43-
checkForm(e: any) {
75+
checkForm(e: Event) {
4476
e.preventDefault()
4577
const lhsTextArea: HTMLTextAreaElement = document.getElementById(
4678
'lhs'

plugins/fart-remover.client.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1+
import { Plugin } from '@nuxt/types'
12
import isDarkModeCookie from '~/helpers/isDarkModeCookie'
3+
declare module 'vue/types/vue' {
4+
// this.$isDarkModeinside Vue components
5+
interface Vue {
6+
$isDarkMode: boolean
7+
}
8+
}
9+
10+
declare module '@nuxt/types' {
11+
// nuxtContext.app.$isDarkModeinside asyncData, fetch, plugins, middleware, nuxtServerInit
12+
interface NuxtAppOptions {
13+
$isDarkMode: boolean
14+
}
15+
// nuxtContext.isDarkMode$
16+
interface Context {
17+
$isDarkMode: boolean
18+
}
19+
}
220

3-
export default function (context: any, inject: any) {
21+
declare module 'vuex/types/index' {
22+
// this.$isDarkModeinside Vuex stores
23+
interface Store<S> {
24+
$isDarkMode: boolean
25+
}
26+
}
27+
28+
const myPlugin: Plugin = (context, inject) => {
429
inject('isDarkMode', isDarkModeCookie())
530
}
31+
32+
export default myPlugin

0 commit comments

Comments
 (0)