The content format.
The type of the content.
The content source.
The content format.
Optional
options: GetContentOptions<Type>The options for getting the content.
// Get the content from a source directly.
const source: ContentSource<ContentFormat.Text> = {
content: "Hello, world!",
};
const content = await getContent(source, ContentFormat.Text);
console.log(content); // "Hello, world!"
// Get the content from a file.
const source: ContentSource<ContentFormat.Text> = {
src: "file.txt",
};
const content = await getContent(source, ContentFormat.Text);
console.log(content); // "Hello, world!"
Get the content from a source. If the source is read, it is saved to the content source, making it available for future use.