121 lines
2.4 KiB
Markdown
121 lines
2.4 KiB
Markdown
[bandcamp-fetch](../README.md) / BaseAPI
|
|
|
|
# Class: BaseAPI
|
|
|
|
## Hierarchy
|
|
|
|
- **`BaseAPI`**
|
|
|
|
↳ [`BaseAPIWithImageSupport`](BaseAPIWithImageSupport.md)
|
|
|
|
↳ [`ImageAPI`](ImageAPI.md)
|
|
|
|
↳ [`AutocompleteAPI`](AutocompleteAPI.md)
|
|
|
|
↳ [`StreamAPI`](StreamAPI.md)
|
|
|
|
## Table of contents
|
|
|
|
### Constructors
|
|
|
|
- [constructor](BaseAPI.md#constructor)
|
|
|
|
### Accessors
|
|
|
|
- [cache](BaseAPI.md#cache)
|
|
|
|
### Methods
|
|
|
|
- [fetch](BaseAPI.md#fetch)
|
|
|
|
## Constructors
|
|
|
|
### constructor
|
|
|
|
• **new BaseAPI**(`params`)
|
|
|
|
#### Parameters
|
|
|
|
| Name | Type |
|
|
| :------ | :------ |
|
|
| `params` | [`BaseAPIParams`](../interfaces/BaseAPIParams.md) |
|
|
|
|
#### Defined in
|
|
|
|
[lib/common/BaseAPI.ts:15](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L15)
|
|
|
|
## Accessors
|
|
|
|
### cache
|
|
|
|
• `Protected` `get` **cache**(): [`Cache`](Cache.md)
|
|
|
|
#### Returns
|
|
|
|
[`Cache`](Cache.md)
|
|
|
|
#### Defined in
|
|
|
|
[lib/common/BaseAPI.ts:27](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L27)
|
|
|
|
## Methods
|
|
|
|
### fetch
|
|
|
|
▸ `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`\>
|
|
|
|
#### Defined in
|
|
|
|
[lib/common/BaseAPI.ts:20](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L20)
|
|
|
|
▸ `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`\>
|
|
|
|
#### Defined in
|
|
|
|
[lib/common/BaseAPI.ts:21](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L21)
|
|
|
|
▸ `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`\>
|
|
|
|
#### Defined in
|
|
|
|
[lib/common/BaseAPI.ts:22](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L22)
|