index.d.ts 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import Dispatcher from './dispatcher'
  2. import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'
  3. import { setGlobalOrigin, getGlobalOrigin } from './global-origin'
  4. import Pool from './pool'
  5. import { RedirectHandler, DecoratorHandler } from './handlers'
  6. import BalancedPool from './balanced-pool'
  7. import Client from './client'
  8. import H2CClient from './h2c-client'
  9. import buildConnector from './connector'
  10. import errors from './errors'
  11. import Agent from './agent'
  12. import MockClient from './mock-client'
  13. import MockPool from './mock-pool'
  14. import MockAgent from './mock-agent'
  15. import { SnapshotAgent } from './snapshot-agent'
  16. import { MockCallHistory, MockCallHistoryLog } from './mock-call-history'
  17. import mockErrors from './mock-errors'
  18. import ProxyAgent from './proxy-agent'
  19. import EnvHttpProxyAgent from './env-http-proxy-agent'
  20. import RetryHandler from './retry-handler'
  21. import RetryAgent from './retry-agent'
  22. import { request, pipeline, stream, connect, upgrade } from './api'
  23. import interceptors from './interceptors'
  24. export * from './util'
  25. export * from './cookies'
  26. export * from './eventsource'
  27. export * from './fetch'
  28. export * from './formdata'
  29. export * from './diagnostics-channel'
  30. export * from './websocket'
  31. export * from './content-type'
  32. export * from './cache'
  33. export { Interceptable } from './mock-interceptor'
  34. declare function globalThisInstall (): void
  35. export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
  36. export default Undici
  37. declare namespace Undici {
  38. const Dispatcher: typeof import('./dispatcher').default
  39. const Pool: typeof import('./pool').default
  40. const RedirectHandler: typeof import ('./handlers').RedirectHandler
  41. const DecoratorHandler: typeof import ('./handlers').DecoratorHandler
  42. const RetryHandler: typeof import ('./retry-handler').default
  43. const BalancedPool: typeof import('./balanced-pool').default
  44. const Client: typeof import('./client').default
  45. const H2CClient: typeof import('./h2c-client').default
  46. const buildConnector: typeof import('./connector').default
  47. const errors: typeof import('./errors').default
  48. const Agent: typeof import('./agent').default
  49. const setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher
  50. const getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher
  51. const request: typeof import('./api').request
  52. const stream: typeof import('./api').stream
  53. const pipeline: typeof import('./api').pipeline
  54. const connect: typeof import('./api').connect
  55. const upgrade: typeof import('./api').upgrade
  56. const MockClient: typeof import('./mock-client').default
  57. const MockPool: typeof import('./mock-pool').default
  58. const MockAgent: typeof import('./mock-agent').default
  59. const SnapshotAgent: typeof import('./snapshot-agent').SnapshotAgent
  60. const MockCallHistory: typeof import('./mock-call-history').MockCallHistory
  61. const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog
  62. const mockErrors: typeof import('./mock-errors').default
  63. const fetch: typeof import('./fetch').fetch
  64. const Headers: typeof import('./fetch').Headers
  65. const Response: typeof import('./fetch').Response
  66. const Request: typeof import('./fetch').Request
  67. const FormData: typeof import('./formdata').FormData
  68. const caches: typeof import('./cache').caches
  69. const interceptors: typeof import('./interceptors').default
  70. const cacheStores: {
  71. MemoryCacheStore: typeof import('./cache-interceptor').default.MemoryCacheStore,
  72. SqliteCacheStore: typeof import('./cache-interceptor').default.SqliteCacheStore
  73. }
  74. const install: typeof globalThisInstall
  75. }