UNPKG

ze-react-component-library

Version:
47 lines (46 loc) 2.6 kB
import { ReactNode } from "react"; import { TableProps } from "../../components/Table/Table.types"; import { ZEValueDisplayerProps } from "../../ZEValueDisplayer/ZEValueDisplayer"; import { ZESheetProps } from "../../ZESheet/ZESheet.types"; import { ZECardProps } from "../ZECard.types"; import { LogicformAPIResultType, RepresentationType } from "zeroetp-api-sdk"; import { ChartRepresentationProps } from "./common/chart.types"; import { DetailProps } from "../../components/Detail"; export declare const chartTypes: readonly ["bar", "column", "stackedColumn", "line", "pie", "funnel", "map", "area", "treemap", "scatter", "guage", "pareto"]; export declare type ChartType = typeof chartTypes[number]; declare type RepresentationComponentPropsType<T> = T extends "table" ? TableProps : T extends "sheet" ? ZESheetProps : T extends ChartType ? ChartRepresentationProps : T extends "value" ? ZEValueDisplayerProps : T extends "entity" ? { data: TableProps["result"]; tableProps?: ZECardProps["tableProps"]; detailProps?: Pick<DetailProps, "showRefDetail">; } : any; export declare type RepresentationItem<T> = { key: string; title: string; icon: string; tip: string; type: "basic" | "advanced"; hideInMenu?: boolean; component: (props: RepresentationComponentPropsType<T>) => ReactNode; valid: (result: LogicformAPIResultType) => boolean; }; export declare const representationMap: { value: RepresentationItem<"value">; table: RepresentationItem<"table">; sheet: RepresentationItem<"sheet">; column: RepresentationItem<"bar">; stackedColumn: RepresentationItem<"bar">; line: RepresentationItem<"bar">; area: RepresentationItem<"area">; pie: RepresentationItem<"bar">; bar: RepresentationItem<"bar">; map: RepresentationItem<"bar">; treemap: RepresentationItem<"bar">; scatter: RepresentationItem<"scatter">; funnel: RepresentationItem<"funnel">; entity: RepresentationItem<"entity">; guage: RepresentationItem<"guage">; pareto: RepresentationItem<"pareto">; }; export declare const getDefaultRepresentation: (result?: LogicformAPIResultType, pieThreshold?: number, barFirst?: boolean) => RepresentationType | ChartType; declare const representations: (RepresentationItem<"table"> | RepresentationItem<"value"> | RepresentationItem<"bar"> | RepresentationItem<"funnel"> | RepresentationItem<"sheet"> | RepresentationItem<"entity"> | RepresentationItem<"area"> | RepresentationItem<"scatter"> | RepresentationItem<"guage"> | RepresentationItem<"pareto">)[]; export default representations;