/** * @license * Copyright Stbui All Rights Reserved. * https://github.com/stbui/prophet */ export declare type UseUpdateValue = [ (query?: Partial, options?: Partial) => void, { data?: any; total?: number; error?: any; loading?: boolean; loaded?: boolean; } ]; /** * useUpdate * * @param {string} resource * @param {string} id * @param {Object} data * @param {Object} previousData * @param {Object} options * @param {string} options.action * @param {Function} options.onSuccess * @param {Function} options.onFailure * * @returns [update, { data, error, loading, loaded }] * * @example * * import { useUpdate } from '@stbui/prophet-core'; * * const UserUpdate = ({ record }) => { * const [update, { loading, error }] = useUpdate( * 'user', * record.id, * { sex: new Date() }, * record * ); * * if (error) { return error.message; } * * return * }; */ declare const useUpdate: (resource: string, id: string | number, data?: any, previousData?: any, options?: any) => UseUpdateValue; export default useUpdate;