-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpota.d.ts
56 lines (41 loc) · 1 KB
/
pota.d.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// signal
type SignalAccessor<out T> = () => T
type SignalSetter<in T> = (newSignalValue?: T) => SignalChanged
type SignalUpdate<T> = {
(newSignalValue?: T): SignalChanged
(fn: (prevSignalValue: T) => T): SignalChanged
}
type SignalFunction<T> = {
(): T
(newValue: T): SignalChanged
}
type SignalObject<T> = [
SignalAccessor<T>,
SignalSetter<T>,
SignalUpdate<T>,
] & {
read: SignalAccessor<T>
write: SignalSetter<T>
update: SignalUpdate<T>
}
type SignalOptions =
| {
equals?: false | ((a, b) => boolean)
}
| undefined
type SignalChanged = true | false
// props
type When<T> = SignalAccessor<T> | boolean
type Each<T> = SignalAccessor<T> | Iterable<T>
// components
type Component = import('./jsx.d.ts').JSX.ElementType
type Children = import('./jsx.d.ts').JSX.Element
// tests
type Expect = {
toBe: (expected: any) => Promise<any>
toEqual: (expected: any) => Promise<any>
not: {
toBe: (expected: any) => Promise<any>
toEqual: (expected: any) => Promise<any>
}
}