-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patherrors.ts
37 lines (28 loc) · 1.27 KB
/
errors.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineComponent, computed } from 'vue'
import { useStore } from 'vuex'
import { useSubscription } from '..'
defineComponent({
setup() {
// THROWS Argument of type 'string' is not assignable to parameter of type 'Channels'.
let isSubscribing = useSubscription('users')
// THROWS Type 'number' is not assignable to type 'Channel'.
useSubscription([1])
// THROWS Type 'number' is not assignable to type 'string'.
useSubscription([{ channel: 1 }])
// THROWS Argument of type 'ComputedRef<string>' is not assignable to parameter of type 'Channels'.
useSubscription(computed(() => 'users'))
let store = useStore()
useSubscription(
computed(() => ['users']),
// THROWS Type 'Store<any>' is missing the following properties
{ store }
)
// THROWS Argument of type 'ComputedRef<number[]>' is not assignable to parameter of type 'Channels'.
useSubscription(computed(() => [1]))
// THROWS Argument of type 'ComputedRef<{ channel: number; }[]>' is not assignable to parameter of type 'Channels'.
useSubscription(computed(() => [{ channel: 1 }]))
// THROWS This condition will always return 'false' since the types 'boolean' and 'string' have no overlap.
if (isSubscribing.value === 'yes') {
}
}
})