import { type } from "os";

export type CommonResponse<T> = Promise<{
  code: number;
  msg: string;
  success: boolean;
  data: T;
}>;

type CascaderOption = {
  children: CascaderOption[];
  level: number;
  parentCodes: string;
  text: string;
  value: string;
};

export type CascaderResponse = CommonResponse<CascaderOption[]>;

export type LocationResponse = Promise<{
  address: string;
  latitude: number;
  longitude: number;
  lat: number;
  lon: number;
  result: "success" | any;
}>;

export type UploadResponse = CommonResponse<{
  link: string;
  domain: string;
  name: string;
  originalName: string;
}>;

export type WorkflowDynamicFields = { [x: string]: string | number | null };
