2023-06-10 16:52:27 +02:00
|
|
|
[bandcamp-fetch](../README.md) / ImageAPI
|
|
|
|
|
|
|
|
# Class: ImageAPI
|
|
|
|
|
|
|
|
## Hierarchy
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
- [`BaseAPI`](BaseAPI.md)
|
2023-06-10 16:52:27 +02:00
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
↳ **`ImageAPI`**
|
|
|
|
|
|
|
|
↳↳ [`LimiterImageAPI`](LimiterImageAPI.md)
|
2023-06-10 16:52:27 +02:00
|
|
|
|
|
|
|
## Table of contents
|
|
|
|
|
|
|
|
### Constructors
|
|
|
|
|
|
|
|
- [constructor](ImageAPI.md#constructor)
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
### Accessors
|
|
|
|
|
|
|
|
- [cache](ImageAPI.md#cache)
|
|
|
|
|
2023-06-10 16:52:27 +02:00
|
|
|
### Methods
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
- [fetch](ImageAPI.md#fetch)
|
2023-06-10 16:52:27 +02:00
|
|
|
- [getFormat](ImageAPI.md#getformat)
|
|
|
|
- [getFormats](ImageAPI.md#getformats)
|
|
|
|
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
### constructor
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
• **new ImageAPI**(`params`)
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `params` | [`BaseAPIParams`](../interfaces/BaseAPIParams.md) |
|
|
|
|
|
|
|
|
#### Inherited from
|
|
|
|
|
|
|
|
[BaseAPI](BaseAPI.md).[constructor](BaseAPI.md#constructor)
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/common/BaseAPI.ts:15](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L15)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
## Accessors
|
|
|
|
|
|
|
|
### cache
|
|
|
|
|
|
|
|
• `Protected` `get` **cache**(): [`Cache`](Cache.md)
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
[`Cache`](Cache.md)
|
|
|
|
|
|
|
|
#### Inherited from
|
|
|
|
|
|
|
|
BaseAPI.cache
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/common/BaseAPI.ts:27](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L27)
|
2023-06-10 16:52:27 +02:00
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
### fetch
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
▸ `Protected` **fetch**(`url`, `jsonResponse`, `method`, `payload?`): `Promise`<`Response`\>
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `url` | `string` |
|
|
|
|
| `jsonResponse` | ``false`` |
|
|
|
|
| `method` | [`HEAD`](../enums/FetchMethod.md#head) |
|
|
|
|
| `payload?` | `undefined` |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<`Response`\>
|
|
|
|
|
|
|
|
#### Inherited from
|
|
|
|
|
|
|
|
[BaseAPI](BaseAPI.md).[fetch](BaseAPI.md#fetch)
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
|
|
|
[lib/common/BaseAPI.ts:20](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L20)
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
▸ `Protected` **fetch**(`url`, `jsonResponse`, `method?`, `payload?`): `Promise`<`any`\>
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `url` | `string` |
|
|
|
|
| `jsonResponse` | ``true`` |
|
|
|
|
| `method?` | [`FetchMethod`](../enums/FetchMethod.md) |
|
|
|
|
| `payload?` | `Record`<`string`, `any`\> |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<`any`\>
|
|
|
|
|
|
|
|
#### Inherited from
|
|
|
|
|
|
|
|
[BaseAPI](BaseAPI.md).[fetch](BaseAPI.md#fetch)
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/common/BaseAPI.ts:21](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L21)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
▸ `Protected` **fetch**(`url`, `jsonResponse?`, `method?`, `payload?`): `Promise`<`string`\>
|
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `url` | `string` |
|
|
|
|
| `jsonResponse?` | `boolean` |
|
|
|
|
| `method?` | [`FetchMethod`](../enums/FetchMethod.md) |
|
|
|
|
| `payload?` | `Record`<`string`, `any`\> |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<`string`\>
|
|
|
|
|
|
|
|
#### Inherited from
|
|
|
|
|
|
|
|
[BaseAPI](BaseAPI.md).[fetch](BaseAPI.md#fetch)
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/common/BaseAPI.ts:22](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L22)
|
2023-10-28 14:55:26 +02:00
|
|
|
|
|
|
|
___
|
|
|
|
|
2023-06-10 16:52:27 +02:00
|
|
|
### getFormat
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
▸ **getFormat**(`target?`, `fallbackId?`): `Promise`<``null`` \| [`ImageFormat`](../interfaces/ImageFormat.md)\>
|
2023-06-10 16:52:27 +02:00
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `target?` | `string` \| `number` \| [`ImageFormat`](../interfaces/ImageFormat.md) |
|
|
|
|
| `fallbackId?` | `number` |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<``null`` \| [`ImageFormat`](../interfaces/ImageFormat.md)\>
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/image/ImageAPI.ts:27](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/image/ImageAPI.ts#L27)
|
2023-06-10 16:52:27 +02:00
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
### getFormats
|
|
|
|
|
2023-10-28 14:55:26 +02:00
|
|
|
▸ **getFormats**(`filter?`): `Promise`<[`ImageFormat`](../interfaces/ImageFormat.md)[]\>
|
2023-06-10 16:52:27 +02:00
|
|
|
|
|
|
|
#### Parameters
|
|
|
|
|
|
|
|
| Name | Type |
|
|
|
|
| :------ | :------ |
|
|
|
|
| `filter?` | [`ImageFormatFilter`](../enums/ImageFormatFilter.md) |
|
|
|
|
|
|
|
|
#### Returns
|
|
|
|
|
|
|
|
`Promise`<[`ImageFormat`](../interfaces/ImageFormat.md)[]\>
|
|
|
|
|
|
|
|
#### Defined in
|
|
|
|
|
2023-10-29 18:25:17 +01:00
|
|
|
[lib/image/ImageAPI.ts:47](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/image/ImageAPI.ts#L47)
|