matcha-keystone-utils
Version:
Useful features for Keystone 6: validators, fields, componentBlocks...
13 lines (12 loc) • 873 B
TypeScript
import { ListHooks } from "@keystone-6/core/types";
import { BaseListTypeInfo } from "@keystone-6/core/types";
type BeforeOperationType<ListTypeInfo extends BaseListTypeInfo> = Exclude<ListHooks<ListTypeInfo>["beforeOperation"], undefined>;
type BeforeOperationParameter<ListTypeInfo extends BaseListTypeInfo> = Parameters<BeforeOperationType<ListTypeInfo>>[0] & {
fieldKey: string;
};
type HookConfig = {
ref: string;
};
export declare const beforeOperationDeleteOne: <ListTypeInfo extends BaseListTypeInfo>({ ref }: HookConfig) => ({ item, context, fieldKey, operation, }: BeforeOperationParameter<ListTypeInfo>) => Promise<void>;
export declare const beforeOperationDeleteMany: <ListTypeInfo extends BaseListTypeInfo>({ ref }: HookConfig) => ({ item, context, fieldKey, listKey, operation, }: BeforeOperationParameter<ListTypeInfo>) => Promise<void>;
export {};