global.d.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. declare module "*.vue" {
  2. import Vue from "vue";
  3. export default Vue;
  4. }
  5. declare module "element-ui/lib/locale/lang/*" {
  6. export const elementLocale: any;
  7. }
  8. declare module "BMap" {
  9. const x: any;
  10. export default x;
  11. }
  12. declare var BMAP_NORMAL_MAP: any;
  13. declare var BMAP_HYBRID_MAP: any;
  14. interface IAny {
  15. [index: string]: any;
  16. }
  17. interface IError {
  18. // msg: string; 因为做中英文切换 所以msg根据code从语言包中查询
  19. code: number;
  20. }
  21. interface IBaseResult<T = any> extends IError {
  22. data: T;
  23. }
  24. interface IRequest {
  25. <T = any>(url: string, data?: any): Promise<IResult<T>>;
  26. }
  27. interface IResult<T> extends Array<IError | null | T> {
  28. 0: IError | null;
  29. 1: T;
  30. length: 2;
  31. }
  32. interface IUser {
  33. id: Number;
  34. loginAccount: string;
  35. phone: string;
  36. }
  37. interface ILogin {
  38. loginAccount: string;
  39. loginPassword: string;
  40. validateCode: string;
  41. autoLogin?: boolean;
  42. }
  43. interface IMenu {
  44. id: number;
  45. pId: number;
  46. title: string;
  47. remake: string;
  48. }
  49. interface IDict {
  50. key: string;
  51. value: string;
  52. }