@openmrs/esm-styleguide
Version:
The styleguide for OpenMRS SPA
31 lines (30 loc) • 972 B
TypeScript
import { type FetchResponse } from '@openmrs/esm-api';
import { type FHIRLocationResource } from '@openmrs/esm-emr-api';
export interface LocationResponse {
type: string;
total: number;
resourceType: string;
meta: {
lastUpdated: string;
};
link: Array<{
relation: string;
url: string;
}>;
id: string;
entry: Array<FHIRLocationResource>;
}
export interface LoginLocationData {
locations: Array<FHIRLocationResource>;
isLoading: boolean;
totalResults?: number;
hasMore: boolean;
loadingNewData: boolean;
setPage: (size: number | ((_size: number) => number)) => Promise<FetchResponse<LocationResponse>[] | undefined>;
}
export declare function useLocationByUuid(locationUuid?: string): {
location: FHIRLocationResource | null;
error: any;
isLoading: boolean;
};
export declare function useLocations(locationTag?: string, count?: number, searchQuery?: string): LoginLocationData;