@@ -20,7 +20,8 @@ import { writeFile, mkdir } from 'fs/promises'
2020 * pageLayout functions Can be used to type a name.layout.js file
2121 *
2222 * @async
23- * @template {Record<string, any>} T
23+ * @template {Record<string, any>} T - The type of variables passed to the page function
24+ * @template [U=any] U - The return type of the page function (defaults to any)
2425 * @callback PageFunction
2526 * @param {object } params - The parameters for the pageLayout.
2627 * @param {T } params.vars - All default, global, layout, page, and builder vars shallow merged.
@@ -29,24 +30,26 @@ import { writeFile, mkdir } from 'fs/promises'
2930 * @param {PageInfo } params.page - Info about the current page
3031 * @param {PageData<T>[] } params.pages - An array of info about every page
3132 * @param {Object<string, string> } [params.workers] - Map of worker names to their output paths
32- * @returns {Promise<any > | any } The rendered inner page thats compatible with its matched layout
33+ * @returns {Promise<U > | U } The rendered inner page thats compatible with its matched layout
3334 */
3435
3536/**
36- * @template {Record<string, any>} T
37+ * @template {Record<string, any>} T - The type of variables for the page
38+ * @template [U=any] U - The return type of the pageLayout function
3739 * @typedef PageBuilderResult
3840 * @property {object } vars - Any variables resolved by the builder
39- * @property {PageFunction<T> } pageLayout - The function that returns the rendered page
41+ * @property {PageFunction<T, U > } pageLayout - The function that returns the rendered page
4042 */
4143
4244/**
43- * @template {Record<string, any>} T
45+ * @template {Record<string, any>} T - The type of variables for the page
46+ * @template [U=any] U - The return type of the pageLayout function
4447 * @callback PageBuilderType
4548 *
4649 * @param {object } params
4750 * @param {PageInfo } params.pageInfo
4851 * @param {BuilderOptions } [params.options]
49- * @returns {Promise<PageBuilderResult<T>> } - The results of the build step.
52+ * @returns {Promise<PageBuilderResult<T, U >> } - The results of the build step.
5053 */
5154
5255/**
0 commit comments