[ABANDONED] React/Redux front end for the Flexor social network.
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.
 
 

151 lines
3.4 KiB

import { EntityStore } from './entities'
import { Config } from './config'
export enum NotificationType {
Info = 'info',
Success = 'success',
Error = 'error',
Welcome = 'welcome',
}
export enum RequestKey {
Authenticate = 'authenticate',
CreateApp = 'create-app',
CreateGroup = 'create-group',
CreateInvitation = 'create-invitation',
CreatePost = 'create-post',
FetchApp = 'fetch-app',
FetchAppAvailability = 'fetch-app-availability',
FetchApps = 'fetch-apps',
FetchGroup = 'fetch-group',
FetchGroupAvailability = 'fetch-group-availability',
FetchGroupLogs = 'fetch-group-logs',
FetchGroupMembers = 'fetch-group-members',
FetchGroups = 'fetch-groups',
FetchInstallations = 'fetch-installations',
FetchInvitations = 'fetch-invitations',
FetchPost = 'fetch-post',
FetchSelfApps = 'fetch-self-apps',
FetchTimeline = 'fetch-timeline',
FetchUser = 'fetch-user',
FetchUserAvailability = 'fetch-user-availability',
FetchUserPosts = 'fetch-user-posts',
InstallApp = 'install-app',
Register = 'register',
Subscribe = 'subscribe',
UninstallApp = 'uninstall-app',
Unsubscribe = 'unsubscribe',
UpdateApp = 'update-app',
UpdateGroup = 'update-group',
UpdateInstallationSettings = 'update-installation-settings',
UpdateSelf = 'update-self',
}
export enum EntityListKey {
Apps = 'apps',
CreatedApps = 'created-apps',
Groups = 'groups',
GroupMembers = 'group-members',
Logs = 'logs',
Invitations = 'invitations',
Timeline = 'timeline',
}
export type FormValue = string | number | boolean
export interface FormNotification {
field?: string
type: NotificationType
message: string
}
export interface APIRequest {
id: RequestKey
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 {
checked: boolean
authenticated: boolean
userId?: string
}
export interface FormField {
name: string
apiName?: string
value?: FormValue
notification?: FormNotification
}
export interface Form {
[name: string]: FormField
}
export interface EntityList {
entities: string[]
continuation?: string
checked: number
}
export interface FormsState {
form: Form
notification?: FormNotification
}
export interface RegistrationState {
step: number
}
export type ComposerState = {
installations: string[]
selected?: string
error?: string
height: number
}
export enum ColorScheme {
Light = 'light',
Dark = 'dark',
}
export type ThemeState = {
scheme: ColorScheme
name: string
}
export interface EntityListCollection {
[key: string]: EntityList
}
export type ConfigState = Config
export type RequestsState = APIRequestCollection
export type NotificationsState = Notification[]
export type EntitiesState = EntityStore
export type EntityListsState = EntityListCollection
export interface AppState {
authentication: AuthenticationState
composer: ComposerState
config: ConfigState
entities: EntitiesState
forms: FormsState
lists: EntityListsState
notifications: NotificationsState
registration: RegistrationState
requests: RequestsState
theme: ThemeState
}