Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-packages/utils/lib/factory/ajax/commonRequest"

Index

Type aliases

Variables

Functions

Type aliases

MultiPartOptions

MultiPartOptions: { includeNullValues?: boolean; initialFormData?: FormData; mapping?: (value: string | number | boolean | File | Blob | Date | null | undefined) => string | Blob; showLeafArrayIndexes?: boolean }

Type declaration

  • Optional includeNullValues?: boolean
  • Optional initialFormData?: FormData
  • Optional mapping?: (value: string | number | boolean | File | Blob | Date | null | undefined) => string | Blob
      • (value: string | number | boolean | File | Blob | Date | null | undefined): string | Blob
      • Parameters

        • value: string | number | boolean | File | Blob | Date | null | undefined

        Returns string | Blob

  • Optional showLeafArrayIndexes?: boolean

Variables

Const CONTENT_TYPE_JSON

CONTENT_TYPE_JSON: "application/json;charset=utf-8" = "application/json;charset=utf-8"

Functions

commonRequest

  • commonRequest<TRequest, TParams, TResponse>(__namedParameters: { cookieValueAsParam: string[]; location: RouteLocationInterface; multipart: false | true | MultiPartOptions; options: { restNamespace: BaseOptions["restNamespace"]; restNonce?: BaseOptions["restNonce"]; restQuery?: BaseOptions["restQuery"]; restRecreateNonceEndpoint?: BaseOptions["restRecreateNonceEndpoint"]; restRoot: BaseOptions["restRoot"] }; params: TParams & IRouteParamsInterface; routeRequest: TRequest; sendRestNonce: boolean; settings: Partial<{}> }): Promise<TResponse>
  • Build and execute a specific REST query.

    see

    urlBuilder

    throws

    Type parameters

    Parameters

    • __namedParameters: { cookieValueAsParam: string[]; location: RouteLocationInterface; multipart: false | true | MultiPartOptions; options: { restNamespace: BaseOptions["restNamespace"]; restNonce?: BaseOptions["restNonce"]; restQuery?: BaseOptions["restQuery"]; restRecreateNonceEndpoint?: BaseOptions["restRecreateNonceEndpoint"]; restRoot: BaseOptions["restRoot"] }; params: TParams & IRouteParamsInterface; routeRequest: TRequest; sendRestNonce: boolean; settings: Partial<{}> }
      • cookieValueAsParam: string[]
      • location: RouteLocationInterface
      • multipart: false | true | MultiPartOptions
      • options: { restNamespace: BaseOptions["restNamespace"]; restNonce?: BaseOptions["restNonce"]; restQuery?: BaseOptions["restQuery"]; restRecreateNonceEndpoint?: BaseOptions["restRecreateNonceEndpoint"]; restRoot: BaseOptions["restRoot"] }
        • restNamespace: BaseOptions["restNamespace"]
        • Optional restNonce?: BaseOptions["restNonce"]
        • Optional restQuery?: BaseOptions["restQuery"]
        • Optional restRecreateNonceEndpoint?: BaseOptions["restRecreateNonceEndpoint"]
        • restRoot: BaseOptions["restRoot"]
      • params: TParams & IRouteParamsInterface
      • routeRequest: TRequest
      • sendRestNonce: boolean
      • settings: Partial<{}>

    Returns Promise<TResponse>

    Result of REST API

Generated using TypeDoc