-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.ts
62 lines (51 loc) · 1.07 KB
/
types.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
57
58
59
60
61
62
/*
* Copyright (C) 2023 Thirty Meter Telescope International Observatory
* SPDX-License-Identifier: Apache-2.0
*/
export type Done = 'Done'
export type Failed = {
_type: 'Failed'
msg: string
}
export type Unhandled = {
_type: 'Unhandled'
state: string
messageType: string
msg: string
}
export type Option<T> = T | undefined
/**
* A function which returns valid auth token
* @function
*/
export type TokenFactory = () => string | undefined
export type AuthData = {
/**
* a function that returns a valid auth token which has correct access roles and permissions
*/
tokenFactory?: TokenFactory
/**
* username of the logged in user
*/
username?: string
}
export type AppConfig = {
applicationName: string
}
/**
* Shape for Application config module
*/
export type AppConfigModule = {
AppConfig: AppConfig
}
/**
* Subscription is received generally after making WebSocket Stream Request
* @interface
*/
export interface Subscription {
cancel: () => void
}
export type LocationServiceError = {
_type: 'LocationServiceError'
reason: string
}