Skip to content

Commit

Permalink
fix: Add exports of run time checks for Options objects
Browse files Browse the repository at this point in the history
Opted for using barrel exports per feature to simplify overview of API
joerideg committed Sep 10, 2024
1 parent ae9ac1f commit d880939
Showing 4 changed files with 30 additions and 22 deletions.
3 changes: 3 additions & 0 deletions src/features/autosuggest/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { autoSuggest, isAutosuggestOptions } from './autosuggest';
export type * from './suggest-response.type';
export type { AutosuggestOptions } from './autosuggest-options.type';
10 changes: 10 additions & 0 deletions src/features/recs-pathways/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export {
getCategoryWidget,
getGlobalWidget,
getItemWidget,
getKeywordWidget,
getPersonalizedWidget,
getRecentlyViewedWidget,
} from './widgets';
export type * from './widget-options.type';
export type * from './widget-response.type';
14 changes: 14 additions & 0 deletions src/features/search/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export { bestseller, isBestsellerOptions } from './bestseller/bestseller';
export type { BestsellerOptions } from './bestseller/bestseller-options.type';

export { categorySearch, isCategorySearchOptions } from './category-search/category-search';
export type { CategorySearchOptions } from './category-search/category-search-options.type';

export { contentSearch, isContentSearchOptions } from './content-search/content-search';
export type { ContentSearchOptions } from './content-search/content-search-options.type';

export { productSearch, isProductSearchOptions } from './product-search/product-search';
export type { ProductSearchOptions } from './product-search/product-search-options.type';

export type * from './search-response.type';

25 changes: 3 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
export { autoSuggest } from './features/autosuggest/autosuggest';
export type { AutosuggestOptions } from './features/autosuggest/autosuggest-options.type';
export type * from './features/autosuggest/suggest-response.type';
export type * from './features/recs-pathways/widget-options.type';
export type * from './features/recs-pathways/widget-response.type';
export {
getCategoryWidget,
getGlobalWidget,
getItemWidget,
getKeywordWidget,
getPersonalizedWidget,
getRecentlyViewedWidget,
} from './features/recs-pathways/widgets';
export { bestseller } from './features/search/bestseller/bestseller';
export type { BestsellerOptions } from './features/search/bestseller/bestseller-options.type';
export { categorySearch } from './features/search/category-search/category-search';
export type { CategorySearchOptions } from './features/search/category-search/category-search-options.type';
export { contentSearch } from './features/search/content-search/content-search';
export type { ContentSearchOptions } from './features/search/content-search/content-search-options.type';
export { productSearch } from './features/search/product-search/product-search';
export type { ProductSearchOptions } from './features/search/product-search/product-search-options.type';
export type * from './features/search/search-response.type';
export * from './features/autosuggest';
export * from './features/recs-pathways';
export * from './features/search';
export type { Configuration } from './shared/configuration.type';

0 comments on commit d880939

Please sign in to comment.