interfaces.ts 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { Context } from "koa";
  2. export type IService<T = any, R = void> = (ctx: Context, props?: T) => Promise<R>;
  3. export interface IRow {
  4. [key: string]: any
  5. }
  6. export interface IAPP_CONFIG {
  7. port: number;
  8. clickhouse: {
  9. protocol: string;
  10. host: string;
  11. port: number;
  12. user: string;
  13. password: string;
  14. }
  15. }
  16. export interface IDBFieldMeta {
  17. fid: string;
  18. dataType: string;
  19. }
  20. export type ISemanticType = 'quantitative' | 'nominal' | 'ordinal' | 'temporal';
  21. export type IDataType = 'number' | 'integer' | 'boolean' | 'date' | 'string';
  22. export type IAnalyticType = 'dimension' | 'measure';
  23. export interface IField {
  24. key: string;
  25. name?: string;
  26. analyticType: IAnalyticType;
  27. semanticType: ISemanticType;
  28. dataType: IDataType;
  29. }
  30. export interface IMutField {
  31. key: string;
  32. name?: string;
  33. analyticType: IAnalyticType | '?';
  34. semanticType: ISemanticType | '?';
  35. dataType: IDataType | '?';
  36. }