Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PossiblyAuthedNextApiRequest

Hierarchy

  • NextApiRequest
    • PossiblyAuthedNextApiRequest

Implements

  • ReadableStream

Index

Constructors

constructor

Properties

Optional _mws

_mws: string[]

aborted

aborted: boolean

body

body: any

complete

complete: boolean

connection

connection: Socket
deprecate

Use socket instead.

cookies

cookies: {}

Object of cookies from header

Type declaration

  • [key: string]: string

destroyed

destroyed: boolean

env

env: Env

headers

headers: IncomingHttpHeaders

httpVersion

httpVersion: string

httpVersionMajor

httpVersionMajor: number

httpVersionMinor

httpVersionMinor: number

Optional method

method: undefined | string

Only valid for request obtained from http.Server.

Optional preview

preview: undefined | false | true

Optional previewData

previewData: any

Preview data set on the request, if any

query

query: {}

Object of query values from url

Type declaration

  • [key: string]: string | string[]

rawHeaders

rawHeaders: string[]

rawTrailers

rawTrailers: string[]

readable

readable: boolean

Readonly readableEncoding

readableEncoding: BufferEncoding | null

Readonly readableEnded

readableEnded: boolean

Readonly readableFlowing

readableFlowing: boolean | null

Readonly readableHighWaterMark

readableHighWaterMark: number

Readonly readableLength

readableLength: number

Readonly readableObjectMode

readableObjectMode: boolean

socket

socket: Socket

Optional statusCode

statusCode: undefined | number

Only valid for response obtained from http.ClientRequest.

Optional statusMessage

statusMessage: undefined | string

Only valid for response obtained from http.ClientRequest.

Optional totp

totp: any

trailers

trailers: Dict<string>

Optional uid

uid: string | number | null

Optional url

url: undefined | string

Only valid for request obtained from http.Server.

Optional user

user: any | null

Methods

[Symbol.asyncIterator]

  • [Symbol.asyncIterator](): AsyncIterableIterator<any>

_destroy

  • _destroy(error: Error | null, callback: (error?: Error | null) => void): void
  • Parameters

    • error: Error | null
    • callback: (error?: Error | null) => void
        • (error?: Error | null): void
        • Parameters

          • Optional error: Error | null

          Returns void

    Returns void

_read

  • _read(size: number): void

addListener

  • addListener(event: "close", listener: () => void): this
  • addListener(event: "data", listener: (chunk: any) => void): this
  • addListener(event: "end", listener: () => void): this
  • addListener(event: "error", listener: (err: Error) => void): this
  • addListener(event: "pause", listener: () => void): this
  • addListener(event: "readable", listener: () => void): this
  • addListener(event: "resume", listener: () => void): this
  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. error
    5. pause
    6. readable
    7. resume

    Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void
        • (chunk: any): void
        • Parameters

          • chunk: any

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

destroy

  • destroy(error?: Error): void
  • Parameters

    • Optional error: Error

    Returns void

emit

  • emit(event: "close"): boolean
  • emit(event: "data", chunk: any): boolean
  • emit(event: "end"): boolean
  • emit(event: "error", err: Error): boolean
  • emit(event: "pause"): boolean
  • emit(event: "readable"): boolean
  • emit(event: "resume"): boolean
  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "data"
    • chunk: any

    Returns boolean

  • Parameters

    • event: "end"

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: "pause"

    Returns boolean

  • Parameters

    • event: "readable"

    Returns boolean

  • Parameters

    • event: "resume"

    Returns boolean

  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number

isPaused

  • isPaused(): boolean

listenerCount

  • listenerCount(type: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: "close", listener: () => void): this
  • on(event: "data", listener: (chunk: any) => void): this
  • on(event: "end", listener: () => void): this
  • on(event: "error", listener: (err: Error) => void): this
  • on(event: "pause", listener: () => void): this
  • on(event: "readable", listener: () => void): this
  • on(event: "resume", listener: () => void): this
  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void
        • (chunk: any): void
        • Parameters

          • chunk: any

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: "close", listener: () => void): this
  • once(event: "data", listener: (chunk: any) => void): this
  • once(event: "end", listener: () => void): this
  • once(event: "error", listener: (err: Error) => void): this
  • once(event: "pause", listener: () => void): this
  • once(event: "readable", listener: () => void): this
  • once(event: "resume", listener: () => void): this
  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void
        • (chunk: any): void
        • Parameters

          • chunk: any

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

pause

  • pause(): this

pipe

  • pipe<T>(destination: T, options?: undefined | { end?: undefined | false | true }): T
  • Type parameters

    • T: WritableStream

    Parameters

    • destination: T
    • Optional options: undefined | { end?: undefined | false | true }

    Returns T

prependListener

  • prependListener(event: "close", listener: () => void): this
  • prependListener(event: "data", listener: (chunk: any) => void): this
  • prependListener(event: "end", listener: () => void): this
  • prependListener(event: "error", listener: (err: Error) => void): this
  • prependListener(event: "pause", listener: () => void): this
  • prependListener(event: "readable", listener: () => void): this
  • prependListener(event: "resume", listener: () => void): this
  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void
        • (chunk: any): void
        • Parameters

          • chunk: any

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: "close", listener: () => void): this
  • prependOnceListener(event: "data", listener: (chunk: any) => void): this
  • prependOnceListener(event: "end", listener: () => void): this
  • prependOnceListener(event: "error", listener: (err: Error) => void): this
  • prependOnceListener(event: "pause", listener: () => void): this
  • prependOnceListener(event: "readable", listener: () => void): this
  • prependOnceListener(event: "resume", listener: () => void): this
  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void
        • (chunk: any): void
        • Parameters

          • chunk: any

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

push

  • push(chunk: any, encoding?: BufferEncoding): boolean
  • Parameters

    • chunk: any
    • Optional encoding: BufferEncoding

    Returns boolean

rawListeners

  • rawListeners(event: string | symbol): Function[]

read

  • read(size?: undefined | number): any

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeListener

  • removeListener(event: "close", listener: () => void): this
  • removeListener(event: "data", listener: (chunk: any) => void): this
  • removeListener(event: "end", listener: () => void): this
  • removeListener(event: "error", listener: (err: Error) => void): this
  • removeListener(event: "pause", listener: () => void): this
  • removeListener(event: "readable", listener: () => void): this
  • removeListener(event: "resume", listener: () => void): this
  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void
        • (chunk: any): void
        • Parameters

          • chunk: any

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

resume

  • resume(): this

setEncoding

  • setEncoding(encoding: BufferEncoding): this

setMaxListeners

  • setMaxListeners(n: number): this

setTimeout

  • setTimeout(msecs: number, callback?: undefined | (() => void)): this

unpipe

  • unpipe(destination?: NodeJS.WritableStream): this
  • Parameters

    • Optional destination: NodeJS.WritableStream

    Returns this

unshift

  • unshift(chunk: any, encoding?: BufferEncoding): void

wrap

  • wrap(oldStream: ReadableStream): this

Static from

  • from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable
  • A utility method for creating Readable Streams out of iterators.

    Parameters

    • iterable: Iterable<any> | AsyncIterable<any>
    • Optional options: ReadableOptions

    Returns Readable

Generated using TypeDoc