/** * @name useFetch * @author Fajar Rizky Hidayat */ interface FetchProps { service: (resp?: import(".").EventSend) => any; selector: (resp: any) => any; defaultValue?: T; disabledOnDidMount?: boolean; debounceTime?: number; cache?: { key?: string; /** * @name ttl * @description in seconds * */ ttl?: number; /** * @name PeriodTime * @description in ms * */ periodTime?: number; periodically?: boolean; }; deps?: any[]; getData?: (value: any) => void; } type UseFetch = { isEmpty: boolean; loading: boolean; data: T; query: object; setQuery: (value: any | ((obj: any) => any)) => void; clear: (fields?: { except?: ReadonlyArray; only?: ReadonlyArray; }) => void; refresh: () => void; add: (newValue: T, position?: "start" | "end" | number) => void; update: (condition: (data: T) => boolean, newValue: Partial) => void; destroy: (condition: (data: T) => boolean) => void; getQuery: (key: string, defaultValue?: any) => any; has: (key: string) => boolean; cancel: () => void; }; export default function useFetch(props: FetchProps): UseFetch;