Skip to content

beforeDeleteHook

beforeDeleteHook<TCollectionSlug, TDataModel>(slug, fn): (<TDataModel>(props) => void | Promise<void>) | undefined

Defined in: packages/core/src/collections/hooks.ts:148

Types a collection’s beforeDelete hook against a real collection, DataModel, and resolved CollectionConfig.

TCollectionSlug extends string

TDataModel extends GenericDataModel = GenericDataModel

TCollectionSlug

The collection slug doc/collection should be typed as.

(props) => void | Promise<void>

The hook function, checked against the real types.

(<TDataModel>(props) => void | Promise<void>) | undefined

The same function, re-typed to the collection’s loose public hooks.beforeDelete signature.

beforeChangeHook