24 lines
691 B
TypeScript
24 lines
691 B
TypeScript
|
import { z } from 'zod';
|
||
|
|
||
|
const locationSchema = z.object({
|
||
|
url: z.string().url().catch(''),
|
||
|
description: z.string().catch(''),
|
||
|
country: z.string().catch(''),
|
||
|
locality: z.string().catch(''),
|
||
|
region: z.string().catch(''),
|
||
|
postal_code: z.string().catch(''),
|
||
|
street: z.string().catch(''),
|
||
|
origin_id: z.string().catch(''),
|
||
|
origin_provider: z.string().catch(''),
|
||
|
type: z.string().catch(''),
|
||
|
timezone: z.string().catch(''),
|
||
|
geom: z.object({
|
||
|
coordinates: z.tuple([z.number(), z.number()]).nullable().catch(null),
|
||
|
srid: z.string().catch(''),
|
||
|
}).nullable().catch(null),
|
||
|
});
|
||
|
|
||
|
type Location = z.infer<typeof locationSchema>;
|
||
|
|
||
|
export { locationSchema, type Location };
|