vue2-request-utils
Version:
Vue 3 composition API for data fetching. This is a version for Vue 2 by using @vue/composition-api.
19 lines (18 loc) • 654 B
TypeScript
import { Ref } from '@vue/composition-api';
import { Query } from '../createQuery';
export declare type PartialRecord<T> = {
[P in keyof T]: Partial<T[P]>;
};
export declare type RefObject = {
[key: string]: Ref<any>;
};
export declare type UnRef<T> = T extends Ref<infer V> ? V : T;
export declare type UnWrapRefObject<T> = {
[P in keyof T]: UnRef<T[P]>;
};
export declare type ServiceObject = Partial<RequestInit> & {
[key: string]: any;
url: string;
};
export declare type ServiceParams = string | ServiceObject;
export declare type IService<R, P extends unknown[]> = ((...args: P) => ServiceParams) | ServiceParams | Query<R, P>;