UNPKG

@twilio/flex-ui

Version:

Twilio Flex UI

78 lines (77 loc) 3.22 kB
import { Action, Dispatch } from "redux"; import { ComponentStatus } from "../PrivateUtils"; /** * State of the view * * @interface AppStatusState * @property {boolean} isAppStatusPanelOpen - whether the navigation sidebar is open * @category State */ export interface AppStatusState { readonly isAppStatusPanelOpen: boolean; readonly componentAffected: ParsedComponent[]; readonly incidentAffected: ParsedComponent[]; readonly isTwilioStatusAvailable: boolean; readonly tokenExpired: boolean; readonly callInfo: CallInformation; } export interface CallInformation { callNetworkIssues: CallNetworkIssue[]; prevCallPerformed: boolean; callStartTimestamp?: Date; callSid?: string; } export interface AppStatusStateAction extends Action { readonly payload?: any; } export interface ParsedComponent { name: string; id: string; created_at: Date; updated_at: Date; status: ComponentStatus; source: DegradationDetectedSource; incidents?: string[]; } export interface CallNetworkIssue { issueStartTimestamp: Date; issue: string; resolved: boolean; issueEndTimestamp?: Date; } export declare enum DegradationDetectedSource { Summary = "Summary API", Unresolved = "Unresolved API" } export declare const ACTION_TOGGLE_APP_STATUS_PANEL = "ACTION_TOGGLE_APP_STATUS_PANEL"; export declare const ACTION_SHOW_APP_STATUS_PANEL = "ACTION_SHOW_APP_STATUS_PANEL"; export declare const ACTION_HIDE_APP_STATUS_PANEL = "ACTION_HIDE_APP_STATUS_PANEL"; export declare const SET_COMPONENT_AFFECTED_STATUS = "SET_COMPONENT_AFFECTED_STATUS"; export declare const SET_INCIDENT_AFFECTED_STATUS = "SET_INCIDENT_AFFECTED_STATUS"; export declare const SET_TWILIO_STATUS_AVAILABILILTY = "SET_TWILIO_STATUS_AVAILABILILTY"; export declare const SET_TOKEN_EXPIRED = "SET_TOKEN_EXPIRED"; export declare const ADD_NETWORK_ISSUE = "ACTION_ADD_NETWORK_ISSUE"; export declare const REMOVE_NETWORK_ISSUE = "ACTION_REMOVE_NETWORK_ISSUE"; export declare const RESET_NETWORK_ISSUES = "ACTION_RESET_NETWORK_ISSUE"; export declare const SET_PREV_CALL_PERFORMED = "ACTION_SET_PREV_CALL_PERFORMED"; export declare const SET_START_CALL_TIMESTAMP = "ACTION_SET_START_CALL_TIMESTAMP"; export declare const SET_CALL_SID = "ACTION_SET_CALL_SID"; export declare function reduce(state: AppStatusState, action: AppStatusStateAction): AppStatusState; export declare class Actions { private static _dispatcher; static get dispatcher(): Dispatch<any>; static set dispatcher(dispatcher: Dispatch<any>); static toggleAppStatusPanel(): void; static hideAppStatusPanel(): void; static showAppStatusPanel(): void; static setIncidentAffected(obj: ParsedComponent[]): void; static setComponentAffected(obj: ParsedComponent[]): void; static setTwilioStatusAvailibility(payload: boolean): void; static setTokenExpired(): void; static addNetworkIssue(payload: CallNetworkIssue): void; static removeNetworkIssue(payload: CallNetworkIssue): void; static resetNetworkIssues(): void; static setPrevCallPerformed(): void; static setStartCallTimestamp(payload: Date): void; static setCallSid(payload: string | undefined): void; }