@promptbook/remote-server
Version:
It's time for a paradigm shift. The future of software in plain English, French or Latin
24 lines (23 loc) • 988 B
TypeScript
import type { ScraperAndConverterMetadata } from './register/ScraperAndConverterMetadata';
import type { ScraperSourceHandler } from './Scraper';
import type { ScraperIntermediateSource } from './ScraperIntermediateSource';
/**
* @@@
*
* Note: [🌏] Converters are not usable in browser because they produce a files
*/
export type Converter = {
/**
* Metadata of the converter which includes title, mime types, etc.
*/
readonly metadata: ScraperAndConverterMetadata;
/**
* Convert the the file and returns intermediate source or `null` if it can't convert it
*
* For example, convert a `.docx` to `.doc` file
* Or convert a `.pdf` to `.md` file
*
* Note: `$` is used to indicate that this function is not a pure function - it leaves files on the disk and you are responsible for cleaning them by calling `destroy` method of returned object
*/
$convert(source: ScraperSourceHandler): Promise<ScraperIntermediateSource>;
};