# Class Fetcher

- Defined in lib/five/utils/ajax.ts:506

##### Index

### Constructors

constructor

### Methods

ajax
loadImage
preload

## Constructors

### constructor

- new Fetcher(options?: NetworkOptions): Fetcher

  #### Parameters

  - options: NetworkOptions = {}

  #### Returns Fetcher

  - Defined in lib/five/utils/ajax.ts:509

## Methods

### ajax

- ajax<T extends AjaxResponseType = "text">(
  source: string,
  options?: AjaxOptions<T>,
  onLoad?: NetworkSuccessCallback<AjaxResponseTypeMapping<T>>,
  onError?: NetworkErrorCallback,
  onProgress?: NetworkProgressCallback,
  ): Promise<NetworkResponse<AjaxResponseTypeMapping<T>, NetWorkMeta>>

  #### Type Parameters

  - T extends AjaxResponseType = "text"

  #### Parameters

  - source: string
  - options: AjaxOptions<T> = {}
  - onLoad: NetworkSuccessCallback<AjaxResponseTypeMapping<T>> = noop
  - onError: NetworkErrorCallback = noop
  - onProgress: NetworkProgressCallback = noop

  #### Returns Promise<NetworkResponse<AjaxResponseTypeMapping<T>, NetWorkMeta>>

  - Defined in lib/five/utils/ajax.ts:513

### loadImage

- loadImage<T extends HTMLImageElement = HTMLImageElement>(
  source: string,
  options?: NetworkOptions,
  onLoad?: NetworkSuccessCallback,
  onError?: NetworkErrorCallback,
  onProgress?: NetworkProgressCallback,
  target?: T,
  ): Promise<NetworkResponse<T, NetWorkMeta>>

  #### Type Parameters

  - T extends HTMLImageElement = HTMLImageElement

  #### Parameters

  - source: string
  - options: NetworkOptions = {}
  - onLoad: NetworkSuccessCallback = noop
  - onError: NetworkErrorCallback = noop
  - onProgress: NetworkProgressCallback = noop
  - `Optional` target: T

  #### Returns Promise<NetworkResponse<T, NetWorkMeta>>

  - Defined in lib/five/utils/ajax.ts:540

### preload

- preload(source: string, options?: NetworkOptions): Promise<void>

  #### Parameters

  - source: string
  - options: NetworkOptions = {}

  #### Returns Promise<void>

  - Defined in lib/five/utils/ajax.ts:568