Configuration for this Eleventy plugin.

interface Config {
    collectionName?: string;
    rules: {
        audioInnerHTML?: ((...args) => string);
        cssSelectors?: string[];
        hosting: {
            config: {} & {
                [k: string]: unknown;
            };
            write: ((...args) => Promise<{
                error?: undefined;
                value: {
                    href: string;
                    message: string;
                };
            } | {
                error: Error;
                value?: undefined;
            }>);
        };
        regex?: RegExp;
        synthesis: {
            config: {} & {
                [k: string]: unknown;
            };
            extension: string;
            synthesize: ((...args) => Promise<{
                error?: undefined;
                value: Readable;
            } | {
                error: Error;
                value?: undefined;
            }>);
        };
        xPathExpressions?: string[];
    }[];
    transformName?: string;
}

Properties

collectionName?: string = ...

Name of the 11ty collection created by this plugin.

Remarks

If you register this plugin more than once, you will need to use a different name every time (otherwise 11ty would throw an Error).

rules: {
    audioInnerHTML?: ((...args) => string);
    cssSelectors?: string[];
    hosting: {
        config: {} & {
            [k: string]: unknown;
        };
        write: ((...args) => Promise<{
            error?: undefined;
            value: {
                href: string;
                message: string;
            };
        } | {
            error: Error;
            value?: undefined;
        }>);
    };
    regex?: RegExp;
    synthesis: {
        config: {} & {
            [k: string]: unknown;
        };
        extension: string;
        synthesize: ((...args) => Promise<{
            error?: undefined;
            value: Readable;
        } | {
            error: Error;
            value?: undefined;
        }>);
    };
    xPathExpressions?: string[];
}[] = ...

Rules that determine which texts to convert into speech.

Type declaration

  • Optional audioInnerHTML?: ((...args) => string)
      • (...args): string
      • Parameters

        • Rest ...args: [string[], ...unknown[]]

        Returns string

  • Optional cssSelectors?: string[]
  • hosting: {
        config: {} & {
            [k: string]: unknown;
        };
        write: ((...args) => Promise<{
            error?: undefined;
            value: {
                href: string;
                message: string;
            };
        } | {
            error: Error;
            value?: undefined;
        }>);
    }
    • config: {} & {
          [k: string]: unknown;
      }
    • write: ((...args) => Promise<{
          error?: undefined;
          value: {
              href: string;
              message: string;
          };
      } | {
          error: Error;
          value?: undefined;
      }>)
        • (...args): Promise<{
              error?: undefined;
              value: {
                  href: string;
                  message: string;
              };
          } | {
              error: Error;
              value?: undefined;
          }>
        • Parameters

          • Rest ...args: unknown[]

          Returns Promise<{
              error?: undefined;
              value: {
                  href: string;
                  message: string;
              };
          } | {
              error: Error;
              value?: undefined;
          }>

  • Optional regex?: RegExp
  • synthesis: {
        config: {} & {
            [k: string]: unknown;
        };
        extension: string;
        synthesize: ((...args) => Promise<{
            error?: undefined;
            value: Readable;
        } | {
            error: Error;
            value?: undefined;
        }>);
    }
    • config: {} & {
          [k: string]: unknown;
      }
    • extension: string
    • synthesize: ((...args) => Promise<{
          error?: undefined;
          value: Readable;
      } | {
          error: Error;
          value?: undefined;
      }>)
        • (...args): Promise<{
              error?: undefined;
              value: Readable;
          } | {
              error: Error;
              value?: undefined;
          }>
        • Parameters

          • Rest ...args: [string, ...unknown[]]

          Returns Promise<{
              error?: undefined;
              value: Readable;
          } | {
              error: Error;
              value?: undefined;
          }>

  • Optional xPathExpressions?: string[]
transformName?: string = ...

Name of the 11ty transform created by this plugin.

Remarks

If you register this plugin more than once, you will need to use a different name every time (11ty would NOT throw an Error, but this plugin will not work as expected).