global.d.ts 412 B

123456789101112131415161718192021222324
  1. declare module "*.vue" {
  2. import Vue from "vue";
  3. export default Vue;
  4. }
  5. interface IAny {
  6. [index: string]: any;
  7. }
  8. interface IError {
  9. msg: string;
  10. code: number;
  11. }
  12. interface IBaseResult<T = any> extends IError {
  13. data: T;
  14. }
  15. interface IRequest {
  16. <T = any>(url: string, data?: any): Promise<IResult<T>>;
  17. }
  18. interface IResult<T> extends Array<IError | null | T> {
  19. 0: IError | null;
  20. 1: T;
  21. length: 2;
  22. }