Skip to content

Commit

Permalink
Merge pull request #655 from nextcloud-libraries/fix/export-types
Browse files Browse the repository at this point in the history
feat: Export `isAxiosError` and axios types
  • Loading branch information
Pytal authored Apr 30, 2024
2 parents 4bbe70c + d7e0a6b commit ef511fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const client = Axios.create({
'X-Requested-With': 'XMLHttpRequest',
},
})

const cancelableClient: CancelableAxiosInstance = Object.assign(client, {
CancelToken: Axios.CancelToken,
isCancel: Axios.isCancel,
Expand All @@ -28,3 +29,7 @@ cancelableClient.interceptors.response.use(r => r, onNotLoggedInError)
onRequestTokenUpdate(token => { client.defaults.headers.requesttoken = token })

export default cancelableClient

export { isAxiosError, isCancel } from 'axios'

export type * from 'axios'

0 comments on commit ef511fa

Please sign in to comment.