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.
71 lines
1.5 KiB
71 lines
1.5 KiB
|
|
import { EntityStore } from './entities'
|
|
|
|
export type NotificationType = 'info' | 'success' | 'error'
|
|
|
|
export interface FormNotification {
|
|
field?: string
|
|
type: NotificationType
|
|
message: string
|
|
}
|
|
|
|
export interface APIRequest {
|
|
readonly id: string
|
|
readonly fetching: boolean
|
|
readonly started: number
|
|
readonly succeeded: boolean
|
|
}
|
|
|
|
export interface APIRequestCollection {
|
|
[id: string]: APIRequest
|
|
}
|
|
|
|
export interface Notification {
|
|
readonly id: string
|
|
readonly type: NotificationType
|
|
readonly content: string
|
|
readonly auto: boolean
|
|
readonly expiration: number
|
|
}
|
|
|
|
export interface AuthenticationState {
|
|
readonly authenticated: boolean
|
|
readonly userId?: string
|
|
}
|
|
|
|
export interface MenuState {
|
|
readonly collapsed: boolean
|
|
}
|
|
|
|
export interface FormField {
|
|
readonly name: string
|
|
readonly value?: string
|
|
readonly notification?: FormNotification
|
|
}
|
|
|
|
export interface Form {
|
|
[name: string]: FormField
|
|
}
|
|
|
|
export interface FormsState {
|
|
readonly form: Form
|
|
readonly notification?: FormNotification
|
|
}
|
|
|
|
export interface DirectoryState {
|
|
readonly groups: string[]
|
|
readonly continuation?: string
|
|
}
|
|
|
|
export type RequestsState = APIRequestCollection
|
|
export type NotificationsState = readonly Notification[]
|
|
export type EntitiesState = EntityStore
|
|
|
|
export interface AppState {
|
|
authentication: AuthenticationState
|
|
entities: EntitiesState
|
|
forms: FormsState
|
|
menu: MenuState
|
|
notifications: NotificationsState
|
|
requests: RequestsState
|
|
}
|