Skip to content

Commit

Permalink
more readable payload types
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Dec 8, 2023
1 parent b4b8941 commit b8aec5e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/sdk/packages/map/src/types/NetworkLocationAnswerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,17 @@ export interface NetworkLocationAnswerBase<T> {

export const NetworkLocationAnswerSchema = 'network.xyo.location.range.answer'
export type NetworkLocationAnswerSchema = 'network.xyo.location.range.answer'
export type NetworkLocationAnswerPayload = NetworkLocationAnswerBase<{ features: Feature<Point>[] }> &
Payload<{ schema: NetworkLocationAnswerSchema }>
export type NetworkLocationAnswerPayload = Payload<NetworkLocationAnswerBase<{ features: Feature<Point>[] }>, NetworkLocationAnswerSchema>
export const isNetworkLocationAnswer = isPayloadOfSchemaType<NetworkLocationAnswerPayload>(NetworkLocationAnswerSchema)

export const NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'
export type NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'
export type NetworkLocationHeatmapAnswerPayload = Payload<{
schema: NetworkLocationHeatmapAnswerSchema & NetworkLocationAnswerBase<{ features: Feature<Polygon>[] }>
}>
export type NetworkLocationHeatmapAnswerPayload = Payload<NetworkLocationAnswerBase<{ features: Feature<Polygon>[] }>, NetworkLocationHeatmapAnswerSchema>
export const isNetworkLocationHeatmapAnswer = isPayloadOfSchemaType<NetworkLocationHeatmapAnswerPayload>(NetworkLocationHeatmapAnswerSchema)

export const NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'
export type NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'
export type NetworkLocationHeatmapQuadkeyAnswerPayload = Payload<
{
schema: NetworkLocationHeatmapQuadkeyAnswerSchema
} & NetworkLocationAnswerBase<{ density: number; quadkey: string }[]>
>
export type NetworkLocationHeatmapQuadkeyAnswerPayload = Payload<NetworkLocationAnswerBase<{ density: number; quadkey: string }[]>, NetworkLocationHeatmapQuadkeyAnswerSchema>
export const isNetworkLocationHeatmapQuadkeyAnswer = isPayloadOfSchemaType<NetworkLocationHeatmapAnswerPayload>(
NetworkLocationHeatmapQuadkeyAnswerSchema,
)

0 comments on commit b8aec5e

Please sign in to comment.