@@ -105,6 +105,14 @@ export class AttachmentQueue {
105105 id? : string ;
106106 updateHook? : (transaction : Transaction , attachment : AttachmentRecord ) => Promise <void >;
107107 }): Promise <AttachmentRecord >;
108+ saveFileFromUri(input : {
109+ localUri: string ;
110+ fileExtension: string ;
111+ mediaType? : string ;
112+ metaData? : string ;
113+ id? : string ;
114+ updateHook? : (transaction : Transaction , attachment : AttachmentRecord ) => Promise <void >;
115+ }): Promise <AttachmentRecord >;
108116 startSync(): Promise <void >;
109117 stopSync(): Promise <void >;
110118 readonly syncIntervalMs: number ;
@@ -127,6 +135,7 @@ export interface AttachmentQueueOptions {
127135 syncIntervalMs? : number ;
128136 syncThrottleDuration? : number ;
129137 tableName? : string ;
138+ transportAdapter? : AttachmentTransportAdapter ;
130139 watchAttachments: (onUpdate : (attachment : WatchedAttachmentItem []) => Promise <void >, signal : AbortSignal ) => void ;
131140}
132141
@@ -178,6 +187,12 @@ export interface AttachmentTableOptions extends Omit<TableOptions, 'name' | 'col
178187// @alpha
179188export type AttachmentTableRecord = RowType <AttachmentTable >;
180189
190+ // @alpha
191+ export interface AttachmentTransportAdapter {
192+ download(attachment : LocatedAttachmentRecord ): Promise <void >;
193+ upload(attachment : LocatedAttachmentRecord ): Promise <void >;
194+ }
195+
181196// @public (undocumented)
182197export type BaseColumnType <T extends number | string | null > = {
183198 type: ColumnType ;
@@ -242,6 +257,15 @@ export interface BatchedUpdateNotification {
242257 tables: string [];
243258}
244259
260+ // @alpha
261+ export class BufferedAttachmentTransport implements AttachmentTransportAdapter {
262+ constructor (localStorage : LocalStorageAdapter , remoteStorage : RemoteStorageAdapter );
263+ // (undocumented)
264+ download(attachment : LocatedAttachmentRecord ): Promise <void >;
265+ // (undocumented)
266+ upload(attachment : LocatedAttachmentRecord ): Promise <void >;
267+ }
268+
245269// @public (undocumented)
246270export class Column {
247271 constructor (options : ColumnOptions );
@@ -651,11 +675,17 @@ export interface LocalStorageAdapter {
651675 getLocalUri(filename : string ): string ;
652676 initialize(): Promise <void >;
653677 makeDir(path : string ): Promise <void >;
678+ moveFile? (sourceUri : string , targetUri : string ): Promise <number >;
654679 readFile(filePath : string ): Promise <ArrayBuffer >;
655680 rmDir(path : string ): Promise <void >;
656681 saveFile(filePath : string , data : AttachmentData ): Promise <number >;
657682}
658683
684+ // @alpha
685+ export type LocatedAttachmentRecord = AttachmentRecord & {
686+ localUri: string ;
687+ };
688+
659689// @public (undocumented)
660690export abstract class LockContext implements SqlExecutor , DBGetUtils {
661691 // (undocumented)
0 commit comments