Skip to content

TypeHttp

ts
import { type TypeHttp } from '@bitrix24/b24jssdk'

Implementation:

Methods

getLogger

ts
getLogger(): LoggerBrowser

Returns the current logger.

setLogger

ts
setLogger(logger: LoggerBrowser): void

Sets the logger.

batch

ts
batch(
  calls: any[] | object,
  isHaltOnError: boolean,
  returnAjaxResult ? : boolean
):
Promise<Result>

Executes a batch request.

ParameterTypeDescription
callsany[]|objectBatch of requests.
isHaltOnErrorbooleanHalt execution on error.
returnAjaxResultbooleanReturn Record<string | number, AjaxResult> | AjaxResult[] in response.

Returns a Promise that resolves to a Result object.

call

ts
call(
  method: string,
  params: object,
  start: number
): Promise<AjaxResult>

Calls a method with the specified parameters.

ParameterTypeDescription
methodstringMethod to call.
paramsobjectRequest parameters.
startnumberStarting position.

Returns a Promise that resolves to an AjaxResult object.

setRestrictionManagerParams

ts
setRestrictionManagerParams(params: TypeRestrictionManagerParams): void

Sets parameters for the restriction manager.

ParameterTypeDescription
paramsTypeRestrictionManagerParamsParameters to set.

getRestrictionManagerParams

ts
getRestrictionManagerParams(): TypeRestrictionManagerParams

Returns parameters for the restriction manager.

setLogTag

ts
setLogTag(logTag?: string): void

Sets a tag for logging.

clearLogTag

ts
clearLogTag(): void

Clears the set tag for logging.

setClientSideWarning

ts
setClientSideWarning(value: boolean, message: string): void

Controls the warning about request execution on the front-end side. Used in B4Hook.

Released under the MIT License.