From bf875c2f21ac952d3963c0c4a5230ae0541e4503 Mon Sep 17 00:00:00 2001 From: Alex Prudhomme <78121423+alexprudhomme@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:11:25 -0400 Subject: [PATCH] resolve comments https://coveord.atlassian.net/browse/KIT-3392 --- .../pagination/headless-core-commerce-pagination.ssr.ts | 8 ++++++++ .../headless-core-parameter-manager.ssr.ts | 7 +++++++ .../commerce/core/sort/headless-core-commerce-sort.ssr.ts | 8 ++++++++ .../commerce/core/summary/headless-core-summary.ssr.ts | 7 +++++++ .../commerce/product-view/headless-product-view.ssr.ts | 6 +++++- .../search/did-you-mean/headless-did-you-mean.ssr.ts | 7 +++++++ 6 files changed, 42 insertions(+), 1 deletion(-) diff --git a/packages/headless/src/controllers/commerce/core/pagination/headless-core-commerce-pagination.ssr.ts b/packages/headless/src/controllers/commerce/core/pagination/headless-core-commerce-pagination.ssr.ts index 0c59623288d..1822d547246 100644 --- a/packages/headless/src/controllers/commerce/core/pagination/headless-core-commerce-pagination.ssr.ts +++ b/packages/headless/src/controllers/commerce/core/pagination/headless-core-commerce-pagination.ssr.ts @@ -14,6 +14,14 @@ import { export type {Pagination, PaginationProps, PaginationState}; +/** + * Defines a `Pagination` controller instance. + * + * @param props - The configurable `Pagination` properties. + * @returns The `Pagination` controller definition. + * + * @internal + */ export function definePagination< TOptions extends ControllerDefinitionOption | undefined, >(props?: PaginationProps, options?: TOptions) { diff --git a/packages/headless/src/controllers/commerce/core/parameter-manager/headless-core-parameter-manager.ssr.ts b/packages/headless/src/controllers/commerce/core/parameter-manager/headless-core-parameter-manager.ssr.ts index 24fc133d1e6..f71421eb968 100644 --- a/packages/headless/src/controllers/commerce/core/parameter-manager/headless-core-parameter-manager.ssr.ts +++ b/packages/headless/src/controllers/commerce/core/parameter-manager/headless-core-parameter-manager.ssr.ts @@ -33,6 +33,13 @@ export type { CommerceSearchParameters, }; +/** + * Defines a `ParameterManager` controller instance. + * + * @returns The `ParameterManager` controller definition. + * + * @internal + */ export function defineParameterManager< TOptions extends ControllerDefinitionOption | undefined, >(options?: TOptions) { diff --git a/packages/headless/src/controllers/commerce/core/sort/headless-core-commerce-sort.ssr.ts b/packages/headless/src/controllers/commerce/core/sort/headless-core-commerce-sort.ssr.ts index 053e76535a4..501c93c9efe 100644 --- a/packages/headless/src/controllers/commerce/core/sort/headless-core-commerce-sort.ssr.ts +++ b/packages/headless/src/controllers/commerce/core/sort/headless-core-commerce-sort.ssr.ts @@ -10,6 +10,14 @@ import {Sort, SortProps, SortState} from './headless-core-commerce-sort'; export type {Sort, SortProps, SortState}; +/** + * Defines a `Sort` controller instance. + * + * @param props - The configurable `Sort` properties. + * @returns The `Sort` controller definition. + * + * @internal + */ export function defineSort< TOptions extends ControllerDefinitionOption | undefined, >(props?: SortProps, options?: TOptions) { diff --git a/packages/headless/src/controllers/commerce/core/summary/headless-core-summary.ssr.ts b/packages/headless/src/controllers/commerce/core/summary/headless-core-summary.ssr.ts index 14933a7c3b9..ace73ffa7f0 100644 --- a/packages/headless/src/controllers/commerce/core/summary/headless-core-summary.ssr.ts +++ b/packages/headless/src/controllers/commerce/core/summary/headless-core-summary.ssr.ts @@ -19,6 +19,13 @@ export type { SummaryState, }; +/** + * Defines a `Summary` controller instance. + * + * @returns The `Summary` controller definition. + * + * @internal + */ export function defineSummary< TOptions extends ControllerDefinitionOption | undefined, >(options?: TOptions) { diff --git a/packages/headless/src/controllers/commerce/product-view/headless-product-view.ssr.ts b/packages/headless/src/controllers/commerce/product-view/headless-product-view.ssr.ts index 64eb0db00e9..fe6a8413230 100644 --- a/packages/headless/src/controllers/commerce/product-view/headless-product-view.ssr.ts +++ b/packages/headless/src/controllers/commerce/product-view/headless-product-view.ssr.ts @@ -13,7 +13,11 @@ export interface ProductViewDefinition extends SharedControllerDefinitionWithoutProps {} /** - * Defines a `ProductView` controller. + * Defines a `ProductView` controller instance. + * + * This controller is stateless and does not implement a `subscribe` method, + * making it simpler but different from other controllers in the system. + * Its sole purpose is to log an `ec_productView` event. * * @returns The `ProductView` controller definition. * diff --git a/packages/headless/src/controllers/commerce/search/did-you-mean/headless-did-you-mean.ssr.ts b/packages/headless/src/controllers/commerce/search/did-you-mean/headless-did-you-mean.ssr.ts index 9f230019178..73844ef12e2 100644 --- a/packages/headless/src/controllers/commerce/search/did-you-mean/headless-did-you-mean.ssr.ts +++ b/packages/headless/src/controllers/commerce/search/did-you-mean/headless-did-you-mean.ssr.ts @@ -4,6 +4,13 @@ import {DidYouMean, DidYouMeanState} from './headless-did-you-mean'; export type {DidYouMean, DidYouMeanState}; +/** + * Defines a `DidYouMean` controller instance. + * + * @returns The `DidYouMean` controller definition. + * + * @internal + * */ export function defineDidYouMean(): SearchOnlyControllerDefinitionWithoutProps { return { search: true,