JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 357240
  • Score
    100M100P100Q174741F
  • License MIT

TypeScript definitions for co-body

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/co-body) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/co-body

    Summary

    This package contains type definitions for co-body (https://github.com/cojs/co-body).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/co-body.

    index.d.ts

    // Type definitions for co-body 6.1
    // Project: https://github.com/cojs/co-body
    // Definitions by: Joshua DeVinney <https://github.com/geoffreak>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <reference types="node"/>
    
    import * as http from "http";
    import * as qs from "qs";
    
    declare namespace CoBody {
        type Context = http.IncomingMessage | { req: http.IncomingMessage };
    
        interface Parse {
            /**
             * @async
             */
            (context: Context, options?: Options): Promise<any>;
            /**
             * @async
             */
            text: (context: Context, options?: Options) => Promise<any>;
            /**
             * @async
             */
            form: (context: Context, options?: Options) => Promise<any>;
            /**
             * @async
             */
            json: (context: Context, options?: Options) => Promise<any>;
        }
    
        interface Options {
            limit?: number | string | undefined;
            strict?: boolean | undefined;
            queryString?: qs.IParseOptions | undefined;
            jsonTypes?: string[] | undefined;
            returnRawBody?: boolean | undefined;
            formTypes?: string[] | undefined;
            textTypes?: string[] | undefined;
            encoding?: string | undefined;
            length?: number | undefined;
        }
    }
    
    declare var CoBody: CoBody.Parse;
    export = CoBody;
    

    Additional Details

    • Last updated: Mon, 04 Sep 2023 15:40:56 GMT
    • Dependencies: @types/node, @types/qs
    • Global values: none

    Credits

    These definitions were written by Joshua DeVinney.