1.0.32 • Published 2 years ago

@types/jsend v1.0.32

Weekly downloads
297
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/jsend

Summary

This package contains type definitions for jsend (https://github.com/Prestaul/jsend).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsend.

index.d.ts

// Type definitions for jsend 1.0.2
// Project: https://github.com/Prestaul/jsend
// Definitions by: Federico Caselli <https://github.com/CaselIT> 
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace Express {
  export interface Response {
    jsend: jsend.jsendExpress;
  }
}

declare namespace jsend {
  interface JSendObject {
    status: string;
    code?: number | undefined;
    data?: any;
    message?: string | undefined;
  }

  interface jsendCore {
    success(data: Object): JSendObject;
    fail(data: Object): JSendObject;
    error(message: string | { message: string, code?: number | undefined, data?: Object | undefined }): JSendObject;
  }

  interface jsendExpress extends jsendCore {
    (err: string | Object, json?: Object): void
  }

  interface jsend extends jsendCore {
    isValid(json: Object): boolean;
    forward(json: Object, done: (err: any, data: any) => any):void;
    fromArguments(err: string | Object, json?: Object): JSendObject;
    middleware(req: any, res: any, next: Function): any;
  }

  interface jsendExport extends jsend {
    (config?: { strict: boolean }, host?: Object): jsend
  }
  var jsend: jsendExport;
}

declare module "jsend" {
  export = jsend.jsend;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 16:22:48 GMT
  • Dependencies: none
  • Global values: jsend

Credits

These definitions were written by Federico Caselli.

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

4 years ago

1.0.28

9 years ago

1.0.27

9 years ago

1.0.26-alpha

9 years ago

1.0.25-alpha

9 years ago

1.0.24-alpha

9 years ago

1.0.23-alpha

9 years ago

1.0.22-alpha

9 years ago

1.0.21-alpha

9 years ago

1.0.20-alpha

9 years ago

1.0.15-alpha

9 years ago

1.0.14-alpha

9 years ago