Contracts
Type interfaces for UploadApi, transports, and strategies.
Contracts define the integration points between your backend, transport, and strategies.
UploadApi
Your backend adapter implements:
createIntent-- returns a strategy intent describing how the file should be uploadedcomplete-- returns a typed result after the upload finishes- optional
findByChecksumfor deduplication - optional multipart and tus helpers
UploadTransport
Transport handles raw HTTP requests (XHR or fetch). The default implementation uses XHR because it supports upload progress events.
Strategy Contracts
Strategies implement a single method:
start(ctx: StrategyCtx): Promise<void>start(ctx: StrategyCtx): Promise<void>The engine provides file, intent, transport, api, and cursor helpers via the context object.