import { useSDKModel } from './use-models'; import { ApiKeys, PingData } from '../types'; import { useAsync, UseAsyncResult } from './use-async'; import { RawModel } from '../models'; export type UseRawModelType = { model: RawModel; ping: () => UseAsyncResult; }; export const useRaw = (): UseRawModelType => { const model = (useSDKModel(ApiKeys.RAW)); return { model, // @ts-ignore ping: usePing(model), }; }; export const usePing = (model: RawModel) => (): UseAsyncResult => { return useAsync(model.ping.bind(model)); };