@tmlmobilidade/types
Version:
This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.
133 lines (132 loc) • 4.35 kB
TypeScript
import { type GeoJSON } from 'geojson';
import { z } from 'zod';
export declare const ZoneSchema: z.ZodObject<{
_id: z.ZodString;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
} & {
border_color: z.ZodString;
border_opacity: z.ZodNumber;
border_width: z.ZodNumber;
code: z.ZodString;
created_at: z.ZodDate;
fill_color: z.ZodString;
fill_opacity: z.ZodNumber;
geojson: z.ZodRecord<z.ZodString, z.ZodAny>;
is_locked: z.ZodBoolean;
name: z.ZodString;
}, "strict", z.ZodTypeAny, {
_id: string;
created_at: Date;
code: string;
name: string;
geojson: Record<string, any>;
is_locked: boolean;
border_color: string;
border_opacity: number;
border_width: number;
fill_color: string;
fill_opacity: number;
updated_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
}, {
_id: string;
created_at: Date;
code: string;
name: string;
geojson: Record<string, any>;
is_locked: boolean;
border_color: string;
border_opacity: number;
border_width: number;
fill_color: string;
fill_opacity: number;
updated_at?: number | null | undefined;
}>;
export declare const CreateZoneSchema: z.ZodObject<Omit<{
_id: z.ZodString;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>;
} & {
border_color: z.ZodString;
border_opacity: z.ZodNumber;
border_width: z.ZodNumber;
code: z.ZodString;
created_at: z.ZodDate;
fill_color: z.ZodString;
fill_opacity: z.ZodNumber;
geojson: z.ZodRecord<z.ZodString, z.ZodAny>;
is_locked: z.ZodBoolean;
name: z.ZodString;
}, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
code: string;
name: string;
geojson: Record<string, any>;
is_locked: boolean;
border_color: string;
border_opacity: number;
border_width: number;
fill_color: string;
fill_opacity: number;
}, {
code: string;
name: string;
geojson: Record<string, any>;
is_locked: boolean;
border_color: string;
border_opacity: number;
border_width: number;
fill_color: string;
fill_opacity: number;
}>;
export declare const UpdateZoneSchema: z.ZodObject<{
code: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
geojson: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
is_locked: z.ZodOptional<z.ZodBoolean>;
border_color: z.ZodOptional<z.ZodString>;
border_opacity: z.ZodOptional<z.ZodNumber>;
border_width: z.ZodOptional<z.ZodNumber>;
fill_color: z.ZodOptional<z.ZodString>;
fill_opacity: z.ZodOptional<z.ZodNumber>;
}, "strict", z.ZodTypeAny, {
code?: string | undefined;
name?: string | undefined;
geojson?: Record<string, any> | undefined;
is_locked?: boolean | undefined;
border_color?: string | undefined;
border_opacity?: number | undefined;
border_width?: number | undefined;
fill_color?: string | undefined;
fill_opacity?: number | undefined;
}, {
code?: string | undefined;
name?: string | undefined;
geojson?: Record<string, any> | undefined;
is_locked?: boolean | undefined;
border_color?: string | undefined;
border_opacity?: number | undefined;
border_width?: number | undefined;
fill_color?: string | undefined;
fill_opacity?: number | undefined;
}>;
export type Zone = Omit<z.infer<typeof ZoneSchema>, 'geojson'> & {
geojson: GeoJSON;
};
export type CreateZoneDto = Omit<z.infer<typeof CreateZoneSchema>, 'geojson'> & {
geojson: GeoJSON;
};
export type UpdateZoneDto = Partial<CreateZoneDto>;
export declare const ZonePermissionSchema: z.ZodObject<{
agency_ids: z.ZodArray<z.ZodString, "many">;
code_contains: z.ZodArray<z.ZodString, "many">;
municipality_ids: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
municipality_ids: string[];
code_contains: string[];
}, {
agency_ids: string[];
municipality_ids: string[];
code_contains: string[];
}>;
export type ZonePermission = z.infer<typeof ZonePermissionSchema>;