@types/on-headers
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Installation

npm install --save @types/on-headers

Summary

This package contains type definitions for on-headers (https://github.com/jshttp/on-headers).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/on-headers.

index.d.ts

/// <reference types="node" />

import { ServerResponse } from "http";

/**
 * This will add the listener to fire when headers are emitted for res.
 * The listener is passed the response object as its context (this).
 * Headers are considered emitted only once, right before they
 * are sent to the client.
 *
 * When this is called multiple times on the same res, the listeners
 * are fired in the reverse order they were added.
 *
 * @param res HTTP server response object
 * @param listener Function to call prior to headers being emitted,
 *        the response object is passed as this context.
 */
declare function onHeaders(res: ServerResponse, listener: (this: ServerResponse) => void): void;

export = onHeaders;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by John Jeffery, and BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/on-headers

Weekly Downloads

52,995

Version

1.0.3

License

MIT

Unpacked Size

4.28 kB

Total Files

5

Last publish

Collaborators

  • types