@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.
117 lines • 3.33 kB
TypeScript
/// <reference types="node" resolution-mode="require"/>
import { Readable } from 'node:stream';
import { z } from 'zod';
import { S3Client } from '@aws-sdk/client-s3';
export declare const bucket_config: z.ZodObject<{
/**
* Name of the Cloudflare R2 bucket to upload the audio file to.
*/
bucketName: z.ZodString;
/**
* Domain under your control to make your Cloudflare R2 bucket publicly accessible.
*
* @see [developers.cloudflare.com - Create public buckets on R2](https://developers.cloudflare.com/r2/buckets/public-buckets/)
*/
customDomain: z.ZodString;
}, "strip", z.ZodTypeAny, {
bucketName: string;
customDomain: string;
}, {
bucketName: string;
customDomain: string;
}>;
export type BucketConfig = z.input<typeof bucket_config>;
export declare const write_config: z.ZodObject<{
/**
* Name of the audio asset to be uploaded to Cloudflare R2.
*/
assetName: z.ZodString;
/**
* Readable stream containing the audio data to be uploaded to Cloudflare R2.
*/
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>;
export declare const write: (s3: S3Client, cfg: BucketConfig, config: WriteConfig) => Promise<{
error: Error;
value?: undefined;
} | {
value: {
message: string;
href: string;
};
error?: undefined;
}>;
export declare const auth_config: z.ZodObject<{
accessKeyId: z.ZodString;
accountId: z.ZodString;
secretAccessKey: z.ZodString;
}, "strip", z.ZodTypeAny, {
accessKeyId: string;
accountId: string;
secretAccessKey: string;
}, {
accessKeyId: string;
accountId: string;
secretAccessKey: string;
}>;
export type AuthConfig = z.input<typeof auth_config>;
export declare const client_config: z.ZodObject<z.objectUtil.extendShape<{
accessKeyId: z.ZodString;
accountId: z.ZodString;
secretAccessKey: z.ZodString;
}, {
/**
* Name of the Cloudflare R2 bucket to upload the audio file to.
*/
bucketName: z.ZodString;
/**
* Domain under your control to make your Cloudflare R2 bucket publicly accessible.
*
* @see [developers.cloudflare.com - Create public buckets on R2](https://developers.cloudflare.com/r2/buckets/public-buckets/)
*/
customDomain: z.ZodString;
}>, "strip", z.ZodTypeAny, {
bucketName: string;
customDomain: string;
accessKeyId: string;
accountId: string;
secretAccessKey: string;
}, {
bucketName: string;
customDomain: string;
accessKeyId: string;
accountId: string;
secretAccessKey: string;
}>;
export type ClientConfig = z.input<typeof client_config>;
/**
* Client for Cloudflare R2.
*
*/
export declare const defClient: (config: ClientConfig) => {
config: {
bucketName: string;
customDomain: string;
};
write: (config: {
assetName: string;
readable: Readable;
}) => Promise<{
error: Error;
value?: undefined;
} | {
value: {
message: string;
href: string;
};
error?: undefined;
}>;
};
//# sourceMappingURL=cloudflare-r2.d.ts.map