Files
payload/test/hooks/payload-types.ts
Stef Gootzen 33686c6db8 feat: add afterOperation hook (#2697)
* feat: add afterOperation hook for Find operation

* docs: change #afterOperation to #afteroperation

* chore: extract afterOperation in function

* chore: implement afterChange in operations

* docs: use proper CollectionAfterOperationHook

* chore: remove outdated info

* chore: types afterOperation hook

* chore: improves afterOperation tests

* docs: updates description of afterOperation hook

* chore: improve typings

* chore: improve types

* chore: rename index.tsx => index.ts

---------

Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
2023-08-15 14:37:01 +02:00

97 lines
2.0 KiB
TypeScript

/* tslint:disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run `payload generate:types` to regenerate this file.
*/
export interface Config {
collections: {
afterOperation: AfterOperation;
transforms: Transform;
hooks: Hook;
'nested-after-read-hooks': NestedAfterReadHook;
'chaining-hooks': ChainingHook;
relations: Relation;
'hooks-users': HooksUser;
};
globals: {};
}
export interface AfterOperation {
id: string;
title: string;
updatedAt: string;
createdAt: string;
}
export interface Transform {
id: string;
/**
* @minItems 2
* @maxItems 2
*/
transform?: [number, number];
/**
* @minItems 2
* @maxItems 2
*/
localizedTransform?: [number, number];
updatedAt: string;
createdAt: string;
}
export interface Hook {
id: string;
fieldBeforeValidate?: boolean;
fieldBeforeChange?: boolean;
fieldAfterChange?: boolean;
fieldAfterRead?: boolean;
collectionBeforeValidate?: boolean;
collectionBeforeChange?: boolean;
collectionAfterChange?: boolean;
collectionBeforeRead?: boolean;
collectionAfterRead?: boolean;
updatedAt: string;
createdAt: string;
}
export interface NestedAfterReadHook {
id: string;
text?: string;
group?: {
array?: {
input?: string;
afterRead?: string;
shouldPopulate?: string | Relation;
id?: string;
}[];
subGroup?: {
afterRead?: string;
shouldPopulate?: string | Relation;
};
};
updatedAt: string;
createdAt: string;
}
export interface Relation {
id: string;
title: string;
updatedAt: string;
createdAt: string;
}
export interface ChainingHook {
id: string;
text?: string;
updatedAt: string;
createdAt: string;
}
export interface HooksUser {
id: string;
roles: ('admin' | 'user')[];
updatedAt: string;
createdAt: string;
email?: string;
resetPasswordToken?: string;
resetPasswordExpiration?: string;
loginAttempts?: number;
lockUntil?: string;
password?: string;
}