@types/micro

  • Version 7.3.7
  • Published
  • 5.56 kB
  • 1 dependency
  • MIT license

Install

npm i @types/micro
yarn add @types/micro
pnpm add @types/micro

Overview

TypeScript definitions for micro

Index

Functions

function buffer

buffer: (
req: IncomingMessage,
info?: { limit?: string | number | undefined; encoding?: string | undefined }
) => Promise<Buffer | string>;

    function createError

    createError: (
    code: number,
    msg: string,
    orig?: Error
    ) => Error & { statusCode: number; originalError?: Error | undefined };

      function json

      json: (
      req: IncomingMessage,
      info?: { limit?: string | number | undefined; encoding?: string | undefined }
      ) => Promise<{ [s: string]: any }>;

        function run

        run: (
        req: IncomingMessage,
        res: ServerResponse,
        fn: RequestHandler
        ) => Promise<void>;

          function send

          send: (res: ServerResponse, code: number, data?: any) => Promise<void>;

            function sendError

            sendError: (
            req: IncomingMessage,
            res: ServerResponse,
            info: {
            statusCode?: number | undefined;
            status?: number | undefined;
            message?: string | undefined;
            stack?: string | undefined;
            }
            ) => Promise<void>;

              function serve

              serve: (fn: RequestHandler) => Server;

                function text

                text: (
                req: IncomingMessage,
                info?: { limit?: string | number | undefined; encoding?: string | undefined }
                ) => Promise<string>;

                  Type Aliases

                  type RequestHandler

                  type RequestHandler = (req: IncomingMessage, res: ServerResponse) => any;

                    Package Files (1)

                    Dependencies (1)

                    Dev Dependencies (0)

                    No dev dependencies.

                    Peer Dependencies (0)

                    No peer dependencies.

                    Badge

                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/micro.

                    • Markdown
                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/micro)
                    • HTML
                      <a href="https://www.jsdocs.io/package/@types/micro"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>