UNPKG

@daveyplate/supabase-swr-entities

Version:

An entity management library for Supabase and SWR

25 lines (24 loc) 1.43 kB
export declare function useCreateEntity(): (table?: string | null, entity?: Record<string, any>, params?: Record<string, any> | null, optimisticFields?: Record<string, any> | null) => Promise<{ entity?: Record<string, any>; error?: Error; }>; export declare function useUpdateEntity(): (table?: string | null, id?: string | null, fields?: Record<string, any>, params?: Record<string, any> | null) => Promise<{ entity?: Record<string, any>; error?: Error; }>; export declare function useDeleteEntity(): (table?: string | null, id?: string | null, params?: Record<string, any> | null) => Promise<{ success?: boolean; error?: Error; }>; export declare function useUpdateEntities(): (table: string | null, params: Record<string, any>, fields: Record<string, any>) => Promise<{ success?: boolean; error?: Error; }>; export declare function useDeleteEntities(): (table: string | null, params: Record<string, any>) => Promise<{ success?: boolean; error?: Error; }>; export declare function useMutateEntities(): (table: string | null, entities?: Record<string, any>[] | null, params?: Record<string, any>, opts?: Record<string, any> | boolean) => Promise<any>; export declare function useMutateEntity(): (table?: string | null, id?: string | null, data?: any | null, params?: Record<string, any> | null, opts?: Record<string, any> | boolean) => Promise<Record<string, any>> | { error: Error; };