File tree Expand file tree Collapse file tree
adminforth/types/adapters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,18 @@ export interface StorageAdapter {
8282 * @returns A promise that returns true if the URL belongs to this adapter, false otherwise.
8383 */
8484 isInternalUrl ( url : string ) : Promise < boolean > ;
85+
86+ /**
87+ * Creates an object writer for the specified key and content type.
88+ * For example, this can be used to write large files in chunks or streams (AWS S3 Multipart Upload).
89+ * @param key - The key of the file to be written e.g. "uploads/file.txt"
90+ * @param contentType - The MIME type of the file to be written e.g. "image/png"
91+ */
92+ createWriteStream ( key : string , contentType : string ) : Promise < ObjectWriter > ;
8593}
8694
87-
95+ interface ObjectWriter {
96+ write ( data : string | Buffer | Uint8Array ) : Promise < void > ;
97+ close ( ) : Promise < void > ;
98+ abort ( ) : Promise < void > ;
99+ }
You can’t perform that action at this time.
0 commit comments