| 158 | * Often a "wrapper" for existing tools. |
| 159 | */ |
| 160 | export interface FormatHandler { |
| 161 | /** Name of the tool being wrapped (e.g. "FFmpeg"). */ |
| 162 | name: string; |
| 163 | /** List of supported input/output {@link FileFormat}s. */ |
| 164 | supportedFormats?: FileFormat[]; |
| 165 | |
| 166 | /** Whether the handler supports input of any type. |
| 167 | * Conversion using this handler will be performed only if no other direct conversion is found. |
| 168 | */ |
| 169 | supportAnyInput?: boolean; |
| 170 | |
| 171 | /** |
| 172 | * Whether the handler is ready for use. Should be set in {@link init}. |
| 173 | * If true, {@link doConvert} is expected to work. |
| 174 | */ |
| 175 | ready: boolean; |
| 176 | /** |
| 177 | * Initializes the handler if necessary. |
| 178 | * Should set {@link ready} to true. |
| 179 | */ |
| 180 | init: () => Promise<void>; |
| 181 | /** |
| 182 | * Performs the actual file conversion. |
| 183 | * @param inputFiles Array of {@link FileData} entries, one per input file. |
| 184 | * @param inputFormat Input {@link FileFormat}, the same for all inputs. |
| 185 | * @param outputFormat Output {@link FileFormat}, the same for all outputs. |
| 186 | * @param args Optional arguments as a string array. |
| 187 | * Can be used to perform recursion with different settings. |
| 188 | * @returns Array of {@link FileData} entries, one per generated output file. |
| 189 | */ |
| 190 | doConvert: ( |
| 191 | inputFiles: FileData[], |
| 192 | inputFormat: FileFormat, |
| 193 | outputFormat: FileFormat, |
| 194 | args?: string[] |
| 195 | ) => Promise<FileData[]>; |
| 196 | } |
| 197 | |
| 198 | export class ConvertPathNode { |
| 199 | public handler: FormatHandler; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…