---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [project-index](../index.md) / IndexedHook

# Interface: IndexedHook

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:108](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L108)

A hook registration from a cartridge's hooks.json.

## Properties

### calledFunctions?

> `optional` **calledFunctions**: `object`[]

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:144](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L144)

For custom hooks: each function the project names in `HookMgr.callHook(name, fn, ...)`,
with its line in this script when the script exports it and the call sites that use it.

#### callers

> **callers**: [`HookCaller`](HookCaller.md)[]

#### line?

> `optional` **line**: `number`

#### name

> **name**: `string`

***

### cartridge

> **cartridge**: `string`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:127](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L127)

***

### exports?

> `optional` **exports**: `string`[]

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:126](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L126)

Functions the script exports (custom hooks can be called with any of them).

***

### function?

> `optional` **function**: `string`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:124](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L124)

For system extension points, the function the platform calls: the
extension point's last segment (`afterPOST`, `calculate`). Custom
extension points have no fixed function; callers name it in
`HookMgr.callHook(extensionPoint, functionName, ...)`.

***

### kind

> **kind**: `"system"` \| `"custom"`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:117](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L117)

`system` for platform extension points (`dw.*`: OCAPI/SCAPI hooks and hooks
such as dw.order.calculate): registrations run in cartridge path order, and
the first one that returns a value skips later registrations and the system
implementation. `custom` for your own extension points: every registration runs.

***

### line?

> `optional` **line**: `number`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:135](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L135)

Line of the system hook's function in the script, when found.

***

### name

> **name**: `string`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:110](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L110)

Extension point, for example `dw.ocapi.shop.basket.afterPOST`.

***

### registeredIn?

> `optional` **registeredIn**: `object`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:139](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L139)

The hooks.json that registers this hook, relative to `cartridge`, and the line of its entry.

#### line?

> `optional` **line**: `number`

#### relPath

> **relPath**: `string`

***

### relPath?

> `optional` **relPath**: `string`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:131](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L131)

Resolved script file relative to its cartridge, when it exists.

***

### returnsValue

> **returnsValue**: [`ReturnBehavior`](../type-aliases/ReturnBehavior.md)

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:137](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L137)

For system hooks: whether the function returns a value. `unknown` for custom hooks.

***

### script

> **script**: `string`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:129](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L129)

Script path as written in hooks.json.

***

### scriptCartridge?

> `optional` **scriptCartridge**: `string`

Defined in: [packages/b2c-tooling-sdk/src/project-index/types.ts:133](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/types.ts#L133)

The cartridge the script resolved to, when it isn't `cartridge` (a `*/cartridge/...` script).
