@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
39 lines • 1.35 kB
TypeScript
import { Fs, File } from '../../fs/type';
import { ReadableStream } from 'stream/web';
/**
* Publisher publishes a result file
* TypeScript equivalent of Publisher struct from Go
*/
export declare class Publisher {
private fs;
constructor(fs: Fs);
/**
* PublishSource publishes content from a source buffer to files
* TypeScript equivalent of PublishSource method from Go
*/
publishSource(src: Uint8Array | string, ...filenames: string[]): Promise<void>;
/**
* PublishFiles publishes content from a readable source to files
* TypeScript equivalent of PublishFiles method from Go
*/
publishFiles(src: ReadableStream<Uint8Array>, ...filenames: string[]): Promise<void>;
/**
* Helper method to open multiple files for writing using a MultiWriter approach
*/
private openFilesForWriting;
/**
* Copy Uint8Array content to writer
*/
private copyToWriter;
/**
* Copy ReadableStream content to writer
*/
private copyStreamToWriter;
}
/**
* OpenFileForWriting opens or creates the given file. If the target directory
* does not exist, it gets created.
* TypeScript equivalent of OpenFileForWriting function from Go
*/
export declare function openFileForWriting(fs: Fs, filename: string): Promise<File>;
//# sourceMappingURL=publisher.d.ts.map