import { type TransformAndValidateFunctionResult } from '@dereekb/model';
/**
* A validated create action for a Firebase function.
*
* Wraps a {@link TransformAndValidateFunctionResult} that validates parameters `P` then executes a create operation
* returning `T`. Optionally accepts an input `I`.
*
* @template P - the validated parameters type
* @template T - the created entity type
* @template I - optional input for the create operation
*/
export type FirebaseFunctionCreateAction
= I extends void ? TransformAndValidateFunctionResult
Promise> : TransformAndValidateFunctionResult Promise>;
/**
* Async variant of {@link FirebaseFunctionCreateAction} — the action itself is produced asynchronously.
*/
export type AsyncFirebaseFunctionCreateAction = Promise>;
/**
* A validated read action for a Firebase function. Structurally identical to {@link FirebaseFunctionCreateAction}.
*/
export type FirebaseFunctionReadAction = FirebaseFunctionCreateAction
;
/**
* Async variant of {@link FirebaseFunctionReadAction}.
*/
export type AsyncFirebaseFunctionReadAction
= Promise>;
/**
* A validated update action for a Firebase function.
*
* Takes the entity `T` as input and returns the updated entity.
*/
export type FirebaseFunctionUpdateAction = TransformAndValidateFunctionResult
Promise>;
/**
* Async variant of {@link FirebaseFunctionUpdateAction}.
*/
export type AsyncFirebaseFunctionUpdateAction = Promise>;
/**
* A validated delete action for a Firebase function.
*
* Takes the entity `T` as input and returns void on successful deletion.
*/
export type FirebaseFunctionDeleteAction = TransformAndValidateFunctionResult
Promise>;
/**
* Async variant of {@link FirebaseFunctionDeleteAction}.
*/
export type AsyncFirebaseFunctionDeleteAction = Promise>;