You've already forked AstralRinth
forked from didirus/AstralRinth
feat: modrinth hosting - files tab refactor (#4912)
* feat: api-client module for content v0 * feat: delete unused components + modules + setting * feat: xhr uploading * feat: fs module -> api-client * feat: migrate files.vue to use tanstack * fix: mem leak + other issues * fix: build * feat: switch to monaco * fix: go back to using ace, but improve preloading + theme * fix: styling + dead attrs * feat: match figma * fix: padding * feat: files-new for ui page structure * feat: finalize files.vue * fix: lint * fix: qa * fix: dep * fix: lint * fix: lockfile merge * feat: icons on navtab * fix: surface alternating on table * fix: hover surface color --------- Signed-off-by: Calum H. <contact@cal.engineer> Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
21
packages/api-client/src/core/abstract-upload-client.ts
Normal file
21
packages/api-client/src/core/abstract-upload-client.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { UploadHandle, UploadRequestOptions } from '../types/upload'
|
||||
|
||||
/**
|
||||
* Abstract base class defining upload capability
|
||||
*
|
||||
* All clients that support file uploads must extend this class.
|
||||
* Platform-specific implementations should provide the actual upload mechanism
|
||||
* (e.g., XHR for browser environments).
|
||||
*
|
||||
* Upload goes through the feature chain (auth, retry, circuit-breaker, etc.)
|
||||
* just like regular requests.
|
||||
*/
|
||||
export abstract class AbstractUploadClient {
|
||||
/**
|
||||
* Upload a file with progress tracking
|
||||
* @param path - API path (e.g., '/fs/create')
|
||||
* @param options - Upload options including file, api, version
|
||||
* @returns UploadHandle with promise, onProgress chain, and cancel method
|
||||
*/
|
||||
abstract upload<T = void>(path: string, options: UploadRequestOptions): UploadHandle<T>
|
||||
}
|
||||
Reference in New Issue
Block a user