Interface KosRegionHookData<RegionData, T>

The data returned from the useKosRegions hook.

interface KosRegionHookData<RegionData, T> {
    raw: string[];
    selectedRegion: string;
    updateRegion: ((e) => void);
    regionSelectProps: {
        onChange: ((e) => void);
        value: string;
        options: T[];
    };
    regionModel?: RegionInfoModel<RegionData>;
    regionData?: RegionData;
}

Type Parameters

  • RegionData extends RegionServices.BaseRegionResponse = RegionServices.BaseRegionResponse

    the region data returned from the backend service. The type must extend BaseRegionResponse from the kos-core-model.

  • T extends object = any

    the type of the options returned from the regionMap function.

Properties

raw: string[]

the raw region data returned from the backend service.

selectedRegion: string

the currently selected region.

updateRegion: ((e) => void)

a function that can be used to update the region.

Type declaration

    • (e): void
    • Parameters

      • e: SelectCallback

      Returns void

regionSelectProps: {
    onChange: ((e) => void);
    value: string;
    options: T[];
}

the props that can be spread into a select box component.

Type declaration

  • onChange: ((e) => void)
      • (e): void
      • Parameters

        • e: SelectCallback

        Returns void

  • value: string
  • options: T[]

the region model returned from the backend service.

regionData?: RegionData

the region data returned from the backend service.