import { RemoteType, S3Location, Callback, AbsoluteFilePath, AbsoluteDirectoryPath, GpgKey, Sha256FilePart, S3BucketName, UploadedS3FilePart } from './Types'; import { MapFunc } from 'streamdash'; import { CmdSpawner } from './CmdRunner'; export interface MkdirP { (path: AbsoluteDirectoryPath, next: (e: Error | null) => void): void; } /** * The environment to pass when executing the command to segment, encrypt and * upload to S3 */ export interface Sha256FilePartEncryptEnvironment { OPT_SRC: string; OPT_DD_BS: string; OPT_DD_SKIP: string; OPT_DD_COUNT: string; OPT_DD_IS_LAST: string; OPT_GPG_KEY: string; OPT_DST: string; } export interface MapFuncWithGetEnv extends MapFunc { getEnv(filePartByteCountThreshold: number, a: Sha256FilePart): Sha256FilePartEncryptEnvironment; } export interface Dependencies { unlink: (path: AbsoluteFilePath, next: Callback) => void; cmdSpawner: CmdSpawner; exists: (loc: S3Location, next: Callback) => void; upload: (tmpDir: AbsoluteDirectoryPath, src: AbsoluteFilePath, loc: S3Location, next: Callback) => void; mkdirp: MkdirP; } export declare function getDependencies(rt: RemoteType): Dependencies; export default function getSha256FilePartToUploadedS3FilePartMapFunc({unlink, mkdirp, upload, cmdSpawner, exists}: Dependencies, configDir: AbsoluteDirectoryPath, rootPath: AbsoluteDirectoryPath, s3Bucket: S3BucketName, gpgKey: GpgKey, filePartByteCountThreshold: number): MapFuncWithGetEnv;