38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
/**
|
|
* S3 Data Provider interface - implement this to connect the S3 browser to your backend
|
|
*/
|
|
|
|
export interface IS3Object {
|
|
key: string;
|
|
size?: number;
|
|
lastModified?: string;
|
|
isPrefix?: boolean;
|
|
}
|
|
|
|
export interface IS3ChangeEvent {
|
|
type: 'add' | 'modify' | 'delete';
|
|
key: string;
|
|
bucket: string;
|
|
size?: number;
|
|
lastModified?: Date;
|
|
}
|
|
|
|
export interface IS3DataProvider {
|
|
listObjects(bucket: string, prefix?: string, delimiter?: string): Promise<{ objects: IS3Object[]; prefixes: string[] }>;
|
|
getObject(bucket: string, key: string): Promise<{ content: string; contentType: string; size: number; lastModified: string }>;
|
|
putObject(bucket: string, key: string, base64Content: string, contentType: string): Promise<boolean>;
|
|
deleteObject(bucket: string, key: string): Promise<boolean>;
|
|
deletePrefix(bucket: string, prefix: string): Promise<boolean>;
|
|
getObjectUrl(bucket: string, key: string): Promise<string>;
|
|
moveObject(bucket: string, sourceKey: string, destKey: string): Promise<{ success: boolean; error?: string }>;
|
|
movePrefix(bucket: string, sourcePrefix: string, destPrefix: string): Promise<{ success: boolean; movedCount?: number; error?: string }>;
|
|
}
|
|
|
|
export interface IColumn {
|
|
prefix: string;
|
|
objects: IS3Object[];
|
|
prefixes: string[];
|
|
selectedItem: string | null;
|
|
width: number;
|
|
}
|