index.d.ts 4.3 KB

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