/** * @name useMutation * @author Fajar Rizky Hidayat */ interface UseMutationProps { defaultValue: T; scenario?: Record>; format?: { [P in keyof T]?: (value: T[P], data: T) => T[P]; }; } type SendProps = { scenario?: string; service: (event?: import(".").EventSend) => S; onSuccess?: (data: any) => void; onError?: (e: any) => void; onAlways?: () => void; }; type UseMutation = { processing: boolean; scenario: string; data: (scenario?: string | boolean) => Partial; setData: ( value: Partial<{ [key in import(".").DeepKeys]: any }> | {} ) => void; increment: ( value: Partial<{ [key in import(".").DeepKeys]: any }> | {} ) => void; decrement: ( value: Partial<{ [key in import(".").DeepKeys]: any }> | {} ) => void; send: ["data"], S = any>(option?: SendProps) => S; reset: () => void; cancel: () => void; value: (key: import(".").DeepKeys, defaultValue?: any) => V; add: ( key: import(".").DeepKeys | {}, value: any, position?: "start" | "end" | number ) => void; upsert: ( key: import(".").DeepKeys | {}, val: any, attr?: string[], position?: "start" | "end" | number ) => void; remove: ( key: import(".").DeepKeys | {}, condition?: number | ((data: any) => boolean) ) => void; keys: (scenario?: boolean | string) => { name: string; keys: string[] }[]; setScenario: (scenario: string) => void; }; export default function useMutation( props: UseMutationProps ): UseMutation;