UNPKG

@exromany/lido-csm-sdk

Version:

[![GitHub license](https://img.shields.io/github/license/lidofinance/lido-csm-sdk?color=limegreen)](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [![Version npm](https://img.shields.io/npm/v/@lidofinance/lido-csm-sdk?label=version)](h

20 lines 782 B
export type FetchFn<T> = (url: string) => Promise<T | null>; export type ParseFn<T> = (text: string) => T; export type ValidateFn<T> = (data: T) => boolean; type Fetcher = <T>(url: string, params?: RequestInit, parse?: ParseFn<T>) => Promise<T>; export declare const fetchJson: Fetcher; export declare const fetchWithFallback: <T>(urls: Array<string | null>, fetch: FetchFn<T>) => Promise<NonNullable<Awaited<T>> | void>; type FetchOneOfProps<T> = { urls: Array<string | null>; validate?: ValidateFn<T>; } & ({ fetch?: FetchFn<T>; parse?: never; } | { fetch?: never; parse?: ParseFn<T>; }); type FetchOneOf = <T>(props: FetchOneOfProps<T>) => Promise<T | void>; export declare const fetchOneOf: FetchOneOf; export {}; //# sourceMappingURL=fetch-json.d.ts.map