UNPKG

@seasketch/geoprocessing

Version:

Geoprocessing and reporting framework for SeaSketch 2.0

151 lines (150 loc) 5.67 kB
import { z } from "zod"; /** * Defines a metric in combination with a datasource, with one or more data classes */ export declare const metricGroupSchema: z.ZodObject<{ /** Unique id of metric in project*/ metricId: z.ZodString; /** data classes used by group */ classes: z.ZodArray<z.ZodObject<{ classId: z.ZodString; classKey: z.ZodOptional<z.ZodString>; datasourceId: z.ZodOptional<z.ZodString>; display: z.ZodString; numericClassId: z.ZodOptional<z.ZodNumber>; layerId: z.ZodOptional<z.ZodString>; objectiveId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }, { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }>, "many">; /** unique identifier of what the metric represents, such as its type and method for calculation - e.g. areaOverlap, valueOverlap. To be defined by the user */ type: z.ZodOptional<z.ZodString>; /** Datasource to generate metrics from */ datasourceId: z.ZodOptional<z.ZodString>; /** Optional datasource class key used to source classIds */ classKey: z.ZodOptional<z.ZodString>; /** Optional ID of map layer associated with this metric */ layerId: z.ZodOptional<z.ZodString>; /** group level objective, applies to all classes */ objectiveId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { metricId: string; classes: { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }[]; type?: string | undefined; datasourceId?: string | undefined; classKey?: string | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }, { metricId: string; classes: { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }[]; type?: string | undefined; datasourceId?: string | undefined; classKey?: string | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }>; export declare const metricGroupsSchema: z.ZodArray<z.ZodObject<{ /** Unique id of metric in project*/ metricId: z.ZodString; /** data classes used by group */ classes: z.ZodArray<z.ZodObject<{ classId: z.ZodString; classKey: z.ZodOptional<z.ZodString>; datasourceId: z.ZodOptional<z.ZodString>; display: z.ZodString; numericClassId: z.ZodOptional<z.ZodNumber>; layerId: z.ZodOptional<z.ZodString>; objectiveId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }, { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }>, "many">; /** unique identifier of what the metric represents, such as its type and method for calculation - e.g. areaOverlap, valueOverlap. To be defined by the user */ type: z.ZodOptional<z.ZodString>; /** Datasource to generate metrics from */ datasourceId: z.ZodOptional<z.ZodString>; /** Optional datasource class key used to source classIds */ classKey: z.ZodOptional<z.ZodString>; /** Optional ID of map layer associated with this metric */ layerId: z.ZodOptional<z.ZodString>; /** group level objective, applies to all classes */ objectiveId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { metricId: string; classes: { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }[]; type?: string | undefined; datasourceId?: string | undefined; classKey?: string | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }, { metricId: string; classes: { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }[]; type?: string | undefined; datasourceId?: string | undefined; classKey?: string | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }>, "many">; /** Represents a single metric, having one DataGroup */ export type MetricGroup = z.infer<typeof metricGroupSchema>; export type MetricGroups = z.infer<typeof metricGroupsSchema>;