UNPKG

@jackdbd/eleventy-plugin-text-to-speech

Version:

Eleventy plugin that uses text-to-speech to generate audio assets for your website, then injects audio players in your HTML.

84 lines 2.06 kB
/// <reference types="node" resolution-mode="require"/> import { Readable } from 'node:stream'; import { z } from 'zod'; export declare const client_config: z.ZodObject<{ /** * Base path where the audio asset will be written to the filesystem. * * @example * _site/assets/audio */ assetBasepath: z.ZodString; /** * Subpath/subdomain under your control where the generated audio asset will * be publicly accessible. * * @example * Subpath: /assets/audio * * @example * Subdomain: https://audio.example.com */ hrefBase: z.ZodString; }, "strip", z.ZodTypeAny, { assetBasepath: string; hrefBase: string; }, { assetBasepath: string; hrefBase: string; }>; export type ClientConfig = z.input<typeof client_config>; export declare const write_config: z.ZodObject<{ /** * Name of the audio asset to be written to the filesystem. */ assetName: z.ZodString; /** * Readable stream containing the audio data to be written to the filesystem. */ readable: z.ZodType<Readable, z.ZodTypeDef, Readable>; }, "strip", z.ZodTypeAny, { assetName: string; readable: Readable; }, { assetName: string; readable: Readable; }>; export type WriteConfig = z.input<typeof write_config>; /** * @internal */ export declare const write: (cfg: ClientConfig, config: WriteConfig) => Promise<{ value: { message: string; href: string; }; error?: undefined; } | { error: Error; value?: undefined; }> | { error: Error; }; export declare const defClient: (config: ClientConfig) => { config: { assetBasepath: string; hrefBase: string; }; write: (config: { assetName: string; readable: Readable; }) => Promise<{ value: { message: string; href: string; }; error?: undefined; } | { error: Error; value?: undefined; }> | { error: Error; }; }; //# sourceMappingURL=fs.d.ts.map