chaichai
Version:
[](https://www.npmjs.com/package/chaichai) [](https://www.npmjs.com/package/chaichai) [ • 4.01 kB
TypeScript
import Highcharts from "highcharts";
import { ReactElement } from "react";
import { FeatureCollection } from 'geojson';
import MapboxGL from 'mapbox-gl';
export interface ConfigType {
version: string;
vallarisUrl: string;
jetstreamUrl: string;
andamanUrl: string;
}
export interface MainContextType {
hostV: string | null;
apikeyV: string | null;
tokenV: string | null;
userIdV: number | null;
hostA: string | null;
tokenA: string | null;
}
export interface datasetType {
id: string;
url: string[];
sourceLayer: number | string;
info: any;
style: any;
}
export interface MapserviceType {
id: string;
url: string;
opacity: number | null;
}
export interface vectorType {
id: string;
data: object;
style: any;
}
export interface vectorTileType {
id: string;
url: string[];
sourceLayer: string | number;
style: any;
}
export interface jetstreamVectorType {
id: string;
label: string;
fields: {
vo: string;
storage: string;
latPath: string;
latName: string;
lngPath: string;
lngName: string;
heading: number | null;
};
style: any;
}
export interface MapProps {
className: string;
children: ReactElement;
center: [number, number];
zoom: number;
mapStyle: "default" | "dark";
mapservice: MapserviceType[];
vector: vectorType[];
vectorTile: vectorTileType[];
jetstreamVector: jetstreamVectorType[];
event: {
timestamp: number;
message: any;
} | null;
onMapLoaded: Function;
host: string | null;
token: string | null;
}
export interface ChartType {
options: Highcharts.Options;
fields: any;
event: {
timestamp: number;
message: any;
} | null;
host: string | null;
token: string | null;
}
export interface ImageType {
className: string;
src: string;
width: number;
height: number;
event: {
timestamp: number;
message: any;
} | null;
setting: any;
host: null;
token: null;
}
export interface StreamingType {
children: ReactElement | any;
clientConfig: {
protocols: 'mqtt' | 'mqtts' | 'tcp' | 'tls' | 'ws' | 'wss';
host: string;
port: number;
ssl: boolean;
topic: string | string[];
};
onConnectionSuccess: Function;
onConnectionLost: Function;
onMessageArrived: Function;
}
export interface FloorplanType {
plan: {
id: string;
data: any;
} | null;
device: {
id: string;
data: any;
} | null;
theme: 'light' | 'dark';
onMapLoaded: Function;
onClickDevice: Function;
}
export interface BuildingType {
buildings: any;
theme: 'dark' | 'dark-vekin' | 'light';
defaultColor: string;
selectedColor: string;
center: [number, number];
zoom: number;
pitch: number;
bearing: number;
onClickBuilding: Function;
}
export declare type paramModel = {
id: string;
origin: [number, number];
model: string;
};
export interface BuildingModelType {
buildings?: paramModel;
selectBuilding?: any;
theme: 'dark' | 'dark-vekin' | 'light';
selectedColor: string;
center?: [number, number];
zoom?: number;
pitch?: number;
bearing?: number;
onClickBuilding: Function;
onMapUpdate: Function;
}
export interface FloorplanModelType {
floorplan?: paramModel & {
device: FeatureCollection;
};
theme: 'light' | 'dark';
selectDevice: string | undefined;
selectedStyle: {
color: string;
opacity: number;
};
center?: [number, number];
zoom?: number;
pitch?: number;
bearing?: number;
onClickDevice: (e: MapboxGL.MapLayerEventType) => void;
onMapUpdate: Function;
}