@tanstack/optimistic
Version:
Core optimistic updates library
22 lines (21 loc) • 818 B
TypeScript
import { AllowedFunctionName } from './schema.js';
/**
* Evaluates a function call with the given name and arguments
* @param functionName The name of the function to evaluate
* @param arg The arguments to pass to the function
* @returns The result of the function call
*/
export declare function evaluateFunction(functionName: AllowedFunctionName, arg: unknown): unknown;
/**
* Determines if an object is a function call
* @param obj The object to check
* @returns True if the object is a function call, false otherwise
*/
export declare function isFunctionCall(obj: unknown): boolean;
/**
* Extracts the function name and argument from a function call object.
*/
export declare function extractFunctionCall(obj: Record<string, unknown>): {
functionName: AllowedFunctionName;
argument: unknown;
};