mirror of
https://github.com/balzack/databag.git
synced 2025-04-24 02:25:26 +00:00
preparing asset upload
This commit is contained in:
parent
7ad9cb55fa
commit
7fe3618a72
@ -134,7 +134,7 @@ export interface Attribute {
|
||||
}
|
||||
|
||||
export interface Focus {
|
||||
addTopic(sealed: boolean, type: string, subject: (assetId: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise<string>;
|
||||
addTopic(sealed: boolean, type: string, subject: (asset: {assetId: string, context: any}[]) => any, files: AssetSource[], progress: (percent: number)=>boolean): Promise<string>;
|
||||
setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise<void>;
|
||||
removeTopic(topicId: string): Promise<void>;
|
||||
|
||||
|
@ -215,8 +215,30 @@ export class FocusModule implements Focus {
|
||||
}
|
||||
}
|
||||
|
||||
public async addTopic(sealed: boolean, type: string, subject: (assetId: {assetId: string, transform: string}[]) => any, files: AssetSource[]) {
|
||||
public async addTopic(sealed: boolean, type: string, subject: (asset: {assetId: string, context: any}[]) => any, files: AssetSource[], progress: (percent: nunber)=>boolean): Promise<string> {
|
||||
return '';
|
||||
|
||||
// if not assets
|
||||
// subject callback
|
||||
// format
|
||||
// if sealed
|
||||
// encrypt
|
||||
// add confirmed topic
|
||||
|
||||
// else
|
||||
// add unconfirmed topic
|
||||
// for each asset
|
||||
// if split
|
||||
// for each block
|
||||
// encrypt
|
||||
// upload reporting progress
|
||||
// else
|
||||
// upload reporting progress
|
||||
// subject callback
|
||||
// format
|
||||
// if sealed
|
||||
// encrypt
|
||||
// set subject and confirm
|
||||
}
|
||||
|
||||
public async setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]) {}
|
||||
|
@ -153,7 +153,6 @@ export class SessionModule implements Session {
|
||||
}
|
||||
|
||||
public setFocus(cardId: string | null, channelId: string): Focus {
|
||||
console.log("SESSION SET FOCUS");
|
||||
if (cardId) {
|
||||
return this.contact.setFocus(cardId, channelId);
|
||||
} else {
|
||||
|
@ -110,19 +110,28 @@ export type Tag = {
|
||||
sortOrder: number;
|
||||
};
|
||||
|
||||
enum HostingMode {
|
||||
Inline, // sealed or unsealed, include data in message body
|
||||
Split, // sealed only, split file into blocks
|
||||
Thumb, // unsealed only, server side generate thumbnail from source
|
||||
Copy, // unsealed only, server side preserve data while stripping metadata
|
||||
HighQuality, // unsealed only, server side transcode to high quality
|
||||
MediumQuality, // unsealed only, server side transcode to medium quality
|
||||
LowQuality, // unsealed only, server side transcode to low quality
|
||||
}
|
||||
|
||||
export type AssetSource = {
|
||||
type: string;
|
||||
name: string;
|
||||
mimeType: string;
|
||||
extension: string;
|
||||
path: string;
|
||||
transforms: string[],
|
||||
hosting: {mode: HostingMode, context: any, data?: string, position?: number, size?: number}[],
|
||||
}
|
||||
|
||||
export type Asset = {
|
||||
assetId: string;
|
||||
type: string;
|
||||
encrypted: boolean;
|
||||
transform: string;
|
||||
mimeType: string;
|
||||
extension: string;
|
||||
hosting: HostingMode;
|
||||
};
|
||||
|
||||
export type Group = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user