You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.5 KiB
78 lines
1.5 KiB
|
|
import { EntityStore } from './entities'
|
|
|
|
export type NotificationType = 'info' | 'success' | 'error'
|
|
export type FormValue = string | number | boolean
|
|
|
|
export interface FormNotification {
|
|
field?: string
|
|
type: NotificationType
|
|
message: string
|
|
}
|
|
|
|
export interface APIRequest {
|
|
id: string
|
|
fetching: boolean
|
|
started: number
|
|
succeeded: boolean
|
|
}
|
|
|
|
export interface APIRequestCollection {
|
|
[id: string]: APIRequest
|
|
}
|
|
|
|
export interface Notification {
|
|
id: string
|
|
type: NotificationType
|
|
content: string
|
|
auto: boolean
|
|
}
|
|
|
|
export interface AuthenticationState {
|
|
authenticated: boolean
|
|
userId?: string
|
|
}
|
|
|
|
export interface MenuState {
|
|
collapsed: boolean
|
|
}
|
|
|
|
export interface FormField {
|
|
name: string
|
|
apiName?: string
|
|
value?: FormValue
|
|
notification?: FormNotification
|
|
}
|
|
|
|
export interface Form {
|
|
[name: string]: FormField
|
|
}
|
|
|
|
export interface FormsState {
|
|
form: Form
|
|
notification?: FormNotification
|
|
}
|
|
|
|
export interface DirectoryState {
|
|
groups: string[]
|
|
continuation?: string
|
|
}
|
|
|
|
export interface RegistrationState {
|
|
step: number
|
|
}
|
|
|
|
export type RequestsState = APIRequestCollection
|
|
export type NotificationsState = Notification[]
|
|
export type EntitiesState = EntityStore
|
|
|
|
export interface AppState {
|
|
authentication: AuthenticationState
|
|
directory: DirectoryState
|
|
entities: EntitiesState
|
|
forms: FormsState
|
|
menu: MenuState
|
|
notifications: NotificationsState
|
|
registration: RegistrationState
|
|
requests: RequestsState
|
|
}
|