prodap-chatbot-domain
Version:
Classes utilizadas na resposta de todas as Intents do Assistente Virtual
223 lines (222 loc) • 5.83 kB
TypeScript
import Message from '../base/Message';
import ActionAbstract from '../../action/ActionAbstract';
import ChartTypes from './ChartTypes';
import DataTypes from '../types/DataTypes';
import ButtonNewModal from '../button/ButtonNewModal';
import { ListType, StyleType, TextType } from '../../common/types';
export declare enum AdditionalLabelDestination {
ALL = "ALL",
LABEL = "LABEL",
XAXIS = "XAXIS",
YAXIS = "YAXIS"
}
export type AdditionalLabel = {
destination: AdditionalLabelDestination;
value: string;
};
type Button = ButtonNewModal;
export type BadgeStyle = {
width: number;
height: number;
borderRadius: number;
};
export type ChartStyle = {
parent?: StyleType;
data?: StyleType;
labels?: StyleType | StyleType[];
border?: StyleType;
};
export type CustomLabelPros = {
active?: boolean;
angle?: string | number;
backgroundComponent?: any;
backgroundPadding?: number | Array<any> | {
top: number;
bottom: number;
left: number;
right: number;
};
backgroundStyle?: object | Array<any>;
capHeight?: string | number | Function;
className?: string;
data?: Array<object>;
datum?: object;
desc?: string;
direction?: 'rtl' | 'ltr' | 'inherit';
dx?: string | number | Function;
dy?: string | number | Function;
events?: object;
groupComponent?: any;
height?: number;
id?: string | number | Function;
index?: string | number;
inline?: boolean;
labelPlacement?: 'parallel' | 'perpendicular' | 'vertical';
lineHeight?: string | number | Function | Array<any>;
origin?: {
x: number;
y: number;
};
polar?: boolean;
renderInPortal?: boolean;
scale?: {
x: any;
y: any;
};
style?: object | Array<any>;
tabIndex?: number | Function;
text?: string | number | Function | Array<any>;
textComponent?: any;
textAnchor?: 'start' | 'middle' | 'end' | 'inherit' | Function;
transform?: string | object | Function;
verticalAnchor?: 'start' | 'middle' | 'end';
width?: number;
x?: number;
y?: number;
};
export type CustomLabel = {
destination: AdditionalLabelDestination;
props: CustomLabelPros[];
};
export type LabelComponent = {
angle: number;
dx: number;
dy: number;
yLabelDesc: string;
onlyHasYLabelDesc?: boolean;
backgroundStyle?: {
fill: string;
stroke: string;
};
};
export type XAxisStyle = {
axis: StyleType;
axisLabel: StyleType;
grid: StyleType;
parent: StyleType;
tickLabels: StyleType;
ticks: StyleType;
};
export type YAxisStyle = {
axis: StyleType;
axisLabel: StyleType;
grid: StyleType;
parent: StyleType;
tickLabels: StyleType;
ticks: StyleType;
};
export type ChartAbstractProps = StyleType & {
additionalLabel?: AdditionalLabel;
animate?: boolean;
badgeStyle?: BadgeStyle;
buttons?: Button[];
chartStyle?: ChartStyle;
chartText?: TextType;
color?: string;
customLabel?: CustomLabel | CustomLabel[];
dataType?: DataTypes;
decimalPlaces?: number;
extraSubtitle?: TextType;
footer?: ListType[];
hasCollect?: boolean;
height?: number;
horizontalScroll?: boolean;
isClickable?: boolean;
key?: string;
label: TextType;
labelComponent?: LabelComponent;
legendStyle?: StyleType;
legendTitle?: TextType;
showAxisX?: boolean;
showAxisY?: boolean;
showLegend?: boolean;
style?: StyleType;
subLabel?: string;
subtitle?: TextType;
textMetric?: string;
title?: TextType;
titleAxisX?: string;
updateAt?: string | Date;
url?: string;
value: number;
verticalScroll?: boolean;
width?: number;
xAxisStyle?: XAxisStyle;
yAxisStyle?: YAxisStyle;
xAxisValues?: string[] | number[];
xAxisBolders?: string[] | number[];
yMax?: number;
yMin?: number;
intent?: string;
hasInfo?: boolean;
subLabelXAxis?: boolean;
};
export default class ChartAbstract extends Message {
additionalLabel?: AdditionalLabel;
animate?: boolean;
actions: ActionAbstract[];
badgeStyle?: BadgeStyle;
backgroundZones?: BackgroundZone[];
buttons?: Button[];
chartStyle?: ChartStyle;
chartText?: TextType;
chartType: ChartTypes;
color?: string;
customLabel?: CustomLabel | CustomLabel[];
dataType?: DataTypes;
extraSubtitle?: TextType;
footer?: ListType[];
hasCollect?: boolean;
height?: number;
horizontalScroll?: boolean;
isClickable?: boolean;
key?: string;
label: TextType;
labelComponent?: LabelComponent;
legendStyle?: StyleType;
legendTitle?: TextType;
padding?: number;
showAxisX?: boolean;
showAxisY?: boolean;
showLegend?: boolean;
style?: StyleType;
subLabel?: string;
subtitle?: TextType;
textMetric?: string;
title?: TextType;
titleAxisX?: string;
updateAt?: string | Date;
url?: string;
value: number;
verticalScroll?: boolean;
width?: number;
xAxisStyle?: XAxisStyle;
yAxisStyle?: YAxisStyle;
xAxisValues?: string[] | number[];
xAxisBolders?: string[] | number[];
yMax?: number;
yMin?: number;
hasInfo?: boolean;
subLabelXAxis?: boolean;
constructor(props: ChartAbstractProps, chartType: ChartTypes, text: string);
addAction(...actions: ActionAbstract[]): ChartAbstract;
}
export type BackgroundZone = {
from: number;
to?: number;
color: string;
};
export type Legend = {
color: string;
text: string;
badgeStyle?: BadgeStyle;
style?: StyleType;
icon?: {
base64: string;
height: number;
width: number;
};
refIndexData?: number[];
textMetric?: string;
};
export {};