@tmlmobilidade/types
Version:
118 lines (117 loc) • 4.72 kB
TypeScript
import { type Census, type CensusFeature } from './census.js';
import { type District, type DistrictFeature } from './district.js';
import { type Locality, type LocalityFeature } from './locality.js';
import { type Municipality, type MunicipalityFeature } from './municipality.js';
import { type Parish, type ParishFeature } from './parish.js';
import { z } from 'zod';
/**
* This type represents the location collections available in the database,
* with each collection corresponding to a specific geographic entity.
*/
export interface AvailableLocations {
census: CensusFeature;
districts: DistrictFeature;
localities: LocalityFeature;
municipalities: MunicipalityFeature;
parishes: ParishFeature;
}
/**
* This type represents the aggregated location information,
* combining various geographic entities into a single structure.
* Useful for location-based queries (coordinates) and data retrieval.
*/
export interface Location {
census?: Census | null;
district: District | null;
latitude: number;
locality: Locality | null;
longitude: number;
municipality: Municipality | null;
parish: null | Parish;
}
export declare const GetAllDistrictsQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
}, "strip", z.ZodTypeAny, {
geojson: boolean;
}, {
geojson?: unknown;
}>;
/**
* This type represents the query parameters for fetching all Districts
* from the database, including an optional flag to include GeoJSON data.
*/
export type GetAllDistrictsQuery = z.infer<typeof GetAllDistrictsQuerySchema>;
export declare const GetAllMunicipalitiesQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
} & {
district_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
}, "strip", z.ZodTypeAny, {
geojson: boolean;
district_ids?: string[] | null | undefined;
}, {
geojson?: unknown;
district_ids?: unknown;
}>;
/**
* This type represents the query parameters for fetching all Municipalities
* from the database, including optional filters for District IDs and a flag
* to include GeoJSON data.
*/
export type GetAllMunicipalitiesQuery = z.infer<typeof GetAllMunicipalitiesQuerySchema>;
export declare const GetAllParishesQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
} & {
district_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
} & {
municipality_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
} & {
limit: z.ZodDefault<z.ZodNumber>;
page: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
geojson: boolean;
limit: number;
page: number;
municipality_ids?: string[] | null | undefined;
district_ids?: string[] | null | undefined;
}, {
municipality_ids?: unknown;
geojson?: unknown;
district_ids?: unknown;
limit?: number | undefined;
page?: number | undefined;
}>;
/**
* This type represents the query parameters for fetching all Parishes
* from the database, including optional filters for Municipality IDs,
* pagination options, and a flag to include GeoJSON data.
*/
export type GetAllParishesQuery = z.infer<typeof GetAllParishesQuerySchema>;
export declare const GetAllLocalitiesQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
district_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
municipality_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
parish_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
} & {
limit: z.ZodDefault<z.ZodNumber>;
page: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
geojson: boolean;
limit: number;
page: number;
municipality_ids?: string[] | null | undefined;
district_ids?: string[] | null | undefined;
parish_ids?: string[] | null | undefined;
}, {
municipality_ids?: unknown;
geojson?: unknown;
district_ids?: unknown;
limit?: number | undefined;
page?: number | undefined;
parish_ids?: unknown;
}>;
/**
* This type represents the query parameters for fetching all Localities
* from the database, including optional filters for Parish IDs,
* pagination options, and a flag to include GeoJSON data.
*/
export type GetAllLocalitiesQuery = z.infer<typeof GetAllLocalitiesQuerySchema>;