Files
CT/src/Model/Global/fileTransferModel.ts
T

30 lines
725 B
TypeScript
Raw Normal View History

2024-07-27 17:03:52 +02:00
// this file is responsible for sending and handling files.
import ConnectionModel from "./connectionModel";
import StorageModel from "./storageModel";
2024-07-27 17:41:54 +02:00
import { generateRandomToken } from "../Utility/utility";
2024-07-27 17:03:52 +02:00
export default class FileTransferModel {
2024-07-27 17:41:54 +02:00
storageModel: StorageModel;
connectionModel: ConnectionModel;
// methods
generateTransferData = (): TransferData => {
return {
channel: generateRandomToken(2),
key: generateRandomToken(3),
};
};
// init
constructor(storageModel: StorageModel, connectionModel: ConnectionModel) {
this.storageModel = storageModel;
this.connectionModel = connectionModel;
}
}
export interface TransferData {
channel: string;
key: string;
}