Skip to content

Commit

Permalink
docs(all): tag examples with @example (#3391)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 authored Jan 7, 2025
1 parent 3e7404d commit 52f4973
Show file tree
Hide file tree
Showing 64 changed files with 73 additions and 27 deletions.
4 changes: 2 additions & 2 deletions libs/analytics/src/lib/analytics-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type DaffAnalyticsTrackerFunction = (event: DaffAnalyticsEvent) => Observ
/**
* The tracker type.
*
* Trackers can either be classes:
* @example Implementing a tracker as a class
*
* ```ts
* export class MyTracker implements DaffAnalyticsTracker {
Expand All @@ -30,7 +30,7 @@ export type DaffAnalyticsTrackerFunction = (event: DaffAnalyticsEvent) => Observ
* }
* ```
*
* or functions:
* @example Implementing a tracker as a function
*
* ```ts
* export const trackThis = (event: DaffAnalyticsEvent) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ export const {
/**
* Provides {@link DAFF_AUTH_UNAUTHENTICATED_HOOKS}.
*
* @example
* ```ts
* providers: [
* ...daffAuthProvideUnauthenticatedHooks(
* myReducer1,
* myReducer2
* myHook1,
* myHook2
* )
* ]
* ```
Expand Down
1 change: 1 addition & 0 deletions libs/auth/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil auth reducers.
*
* @example
* ```ts
* providers: [
* ...daffAuthProvideExtraReducers(
Expand Down
1 change: 1 addition & 0 deletions libs/authorizenet/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil authorizenet reducers.
*
* @example
* ```ts
* providers: [
* ...daffAuthorizeNetProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil cart reducers.
*
* @example
* ```ts
* providers: [
* ...daffCartStoreCreditProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export const {
* The value returned by the hook function will be set to the returned cart's `extra_attributes` field
* for driver calls that return a cart.
*
* The following example demonstrates adding the `numberOfCartItems` field to `extra_attributes`:
* Note that this and any `extra_attributes` features are for advanced users
* and should be used with care.
*
* @example Adding the `numberOfCartItems` field to `extra_attributes`
* ```ts
* (reqInfo: RequestInfo, cart: DaffCart) => ({
* numberOfCartItems: cart.items.length
* })
* ```
*
* Note that this and any `extra_attributes` features are for advanced users
* and should be used with care.
*/
token: DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const {
*
* See {@link DAFF_CART_MAGENTO_CART_ITEM_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCartMagentoCartItemTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const {
*
* See {@link DAFF_CART_MAGENTO_CART_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCartMagentoCartTransforms(
Expand Down
1 change: 1 addition & 0 deletions libs/cart/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil cart reducers.
*
* @example
* ```ts
* providers: [
* ...daffCartProvideExtraReducers(
Expand Down
1 change: 1 addition & 0 deletions libs/cart/state/src/reducers/token/meta.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const {
/**
* Provides additional meta-reducers that run after the standard Daffodil cart meta-reducers.
*
* @example
* ```ts
* providers: [
* ...daffCartProvideMetaReducers(
Expand Down
1 change: 1 addition & 0 deletions libs/category/driver/magento/src/fragments/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const {
*
* See {@link MAGENTO_CATEGORY_EXTRA_FRAGMENTS}.
*
* @example
* ```ts
* providers: [
* ...magentoProvideCategoryExtraFragments(
Expand Down
1 change: 1 addition & 0 deletions libs/category/driver/magento/src/transforms/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
*
* See {@link MAGENTO_CATEGORY_EXTRA_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...magentoProvideCategoryExtraTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const {
*
* See {@link DAFF_CATEGORY_ROUTING_OPTIONS_BUILDERS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCategoryRoutingRequestBuilders(
Expand Down
1 change: 1 addition & 0 deletions libs/category/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil category reducers.
*
* @example
* ```ts
* providers: [
* ...daffCategoryProvideExtraReducers(
Expand Down
2 changes: 1 addition & 1 deletion libs/core/external-script/src/external-script.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface LoadedExternalScript extends DaffExternalScript {
*
* ### Usage example
*
* The following loads an external script into the document.
* @example Loading an external script into the document
*
* ```ts
* import { DOCUMENT } from '@angular/common';
Expand Down
3 changes: 1 addition & 2 deletions libs/core/external-script/src/script.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
* Represents the structure of an external script that can be loaded into a document.
*
* @example Using DaffExternalScript interface to define an external script object
* ```ts
* // Example of using DaffExternalScript interface to define an external script object.
*
* const externalScript: DaffExternalScript = {
* src: 'https://example.com/script.js',
* async: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ import { TestScripts } from './constants';
/**
* A service for loading external scripts into the document.
*
* ### Usage example
*
* The following loads an external script into the document.
* @example Loading an external script into the document
*
* ```ts
*
* import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';
*
* const externalScriptService = new DaffExternalScriptTestingService();
Expand Down
2 changes: 1 addition & 1 deletion libs/core/src/constructable/constructable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* A type which describes a function which would return an instance of a class
* Typically, we call this the "new" method in a language.
*
* A sample usage:
* @example
* ```ts
* class MyClass {
* readonly myProp: string = 'prop';
Expand Down
4 changes: 1 addition & 3 deletions libs/core/testing/src/factories/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { IDaffModelFactory } from './factory.interface';
*
* The constructor args can be omitted if the `create` method is overridden.
*
* The following example demonstrates using this feature to inject
* a different factory into a mock class.
*
* @example Injecting a different factory into a mock class
* ```ts
* class MyMockModel {
* constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const {
*
* See {@link DAFF_CUSTOMER_ORDER_MAGENTO_EXTRA_ORDER_FRAGMENTS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCustomerOrderMagentoExtraOrderFragments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const {
*
* See {@link DAFF_CUSTOMER_ORDER_MAGENTO_EXTRA_ORDER_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCustomerOrderMagentoExtraOrderTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const {
*
* See {@link DAFF_CUSTOMER_ORDER_MAGENTO_EXTRA_ORDER_FRAGMENTS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCustomerOrderMagentoExtraOrderFragments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const {
*
* See {@link DAFF_CUSTOMER_ORDER_MAGENTO_EXTRA_ORDER_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffCustomerOrderMagentoExtraOrderTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil customer reducers.
*
* @example
* ```ts
* providers: [
* ...daffCustomerPaymentProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil customer reducers.
*
* @example
* ```ts
* providers: [
* ...daffCustomerStoreCreditProvideExtraReducers(
Expand Down
1 change: 1 addition & 0 deletions libs/customer/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil customer reducers.
*
* @example
* ```ts
* providers: [
* ...daffCustomerProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { DaffExternalRouterMagentoDriver } from './magento.service';
/**
* The module used to configure the {@link DaffExternalRouterDriver} for usage with Magento.
*
* @example
* ```ts
* @NgModule({
* declarations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { DaffExternalRouterMagentoDriver } from './magento.service';
/**
* The module used to configure the {@link DaffExternalRouterDriver} for usage with Magento.
*
* @example
* ```ts
* @NgModule({
* declarations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { DaffExternalRouterMagentoDriver } from './magento.service';
/**
* The module used to configure the {@link DaffExternalRouterDriver} for usage with Magento.
*
* @example
* ```ts
* @NgModule({
* declarations: [],
Expand Down
1 change: 1 addition & 0 deletions libs/external-router/src/model/resolvable-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DaffExternalRouteType } from './route-type';
* A `DaffExternallyResolvableUrl` describes the relationship between a "type" of route
* as determined by an external platform and a URI.
*
* @example
* ```ts
* export const resolvableRoute: DaffExternallyResolvableUrl = {
* id: "id-of-resource",
Expand Down
1 change: 1 addition & 0 deletions libs/navigation/driver/magento/src/transforms/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
*
* See {@link MAGENTO_NAVIGATION_TREE_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...magentoProvideNavigationTreeTransforms(
Expand Down
1 change: 1 addition & 0 deletions libs/order/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil order reducers.
*
* @example
* ```ts
* providers: [
* ...daffOrderProvideExtraReducers(
Expand Down
1 change: 1 addition & 0 deletions libs/payment/state/src/reducers/token/extra.token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil cart reducers.
*
* @example
* ```ts
* providers: [
* ...daffPaymentProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const {
*
* See {@link DAFF_PAYMENT_RESPONSE_KIND_FACTORIES}.
*
* @example
* ```ts
* providers: [
* ...provideDaffPaymentResponseKindFactories(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil cart reducers.
*
* @example
* ```ts
* providers: [
* ...daffProductCompositeProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil cart reducers.
*
* @example
* ```ts
* providers: [
* ...daffProductConfigurableProvideExtraReducers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const {
*
* See {@link DAFF_PRODUCT_IN_MEMORY_EXTRA_PRODUCT_RESPONSE_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductInMemoryExtraProductResponseTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const {
*
* See {@link DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PAGE_FRAGMENTS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductMagentoExtraProductPageFragments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const {
*
* See {@link DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_FRAGMENTS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductMagentoExtraProductPreviewFragments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const {
*
* See {@link DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_FRAGMENTS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductMagentoExtraProductFragments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const {
*
* See {@link DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_PREVIEW_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductMagentoExtraProductPreviewTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const {
*
* See {@link DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_RESPONSE_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductMagentoExtraProductResponseTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const {
*
* See {@link DAFF_PRODUCT_MAGENTO_EXTRA_PRODUCT_TRANSFORMS}.
*
* @example
* ```ts
* providers: [
* ...provideDaffProductMagentoExtraProductTransforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const {
/**
* Provides additional reducers that run after the standard Daffodil cart reducers.
*
* @example
* ```ts
* providers: [
* ...daffProductProvideExtraReducers(
Expand Down
Loading

0 comments on commit 52f4973

Please sign in to comment.