Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "types"

Index

Type aliases

IsAny

IsAny<T>: (T extends typeof phantom ? true : false) extends false ? false : true

Resolves to true if and only if T is any, false otherwise.

Type parameters

  • T

IsUnknown

IsUnknown<T>: IsAny<T> extends true ? false : unknown extends T ? true : false

Resolves to true if and only if T is unknown, false otherwise.

Type parameters

  • T

KnownOrDefault

KnownOrDefault<T, K, D>: IsUnknown<T[K]> extends true ? {} : D extends T[K] ? {} : {}

Type parameters

  • T

  • K: keyof T

  • D

MethodFetchArgs

MethodFetchArgs<T>: [data: T & { req?: RequestInit }]

Type parameters

MethodImpls

MethodImpls<M, Tr, Ur>: {}

Type parameters

Type declaration

RequestData

RequestData<T>: (IsAny<T> extends true ? true : keyof T extends keyof RequestDataTemplate ? true : false) extends true ? {} & KnownOrDefault<T, "contentType", "application/json"> & KnownOrDefault<T, "params", {}> & KnownOrDefault<T, "query", {}> & KnownOrDefault<T, "body", undefined> : void

Describes type information of request data based on RequestDataTemplate.

Example

RequestData<{
  contentType: 'application/json'
  params: { id: string }
  query: { name: string }
}>

Type parameters

ResponseData

ResponseData<T>: (IsAny<T> extends true ? true : keyof T extends keyof ResponseDataTemplate ? true : false) extends true ? {} & KnownOrDefault<T, "contentType", "application/json"> & KnownOrDefault<T, "status", 200> & KnownOrDefault<T, "body", undefined> : void

Describes type information of response data based on ResponseDataTemplate.

Example

ResponseData<{
  status: 200 | 404
  body: { content: string }
}>

Type parameters

SupportedContentType

SupportedContentType: "application/json" | "application/x-www-form-urlencoded" | "text/plain"

Generated using TypeDoc