terra-draw
Version:
Frictionless map drawing across mapping provider
23 lines (22 loc) • 1.3 kB
TypeScript
import { Validation } from "../common";
import { FeatureId, IdStrategy } from "./store";
export declare const StoreValidationErrors: {
readonly FeatureHasNoId: "Feature has no id";
readonly FeatureIsNotObject: "Feature is not object";
readonly InvalidTrackedProperties: "updatedAt and createdAt are not valid timestamps";
readonly FeatureHasNoMode: "Feature does not have a set mode";
readonly FeatureIdIsNotValidGeoJSON: "Feature must be string or number as per GeoJSON spec";
readonly FeatureIdIsNotValid: "Feature must match the id strategy (default is UUID4)";
readonly FeatureHasNoGeometry: "Feature has no geometry";
readonly FeatureHasNoProperties: "Feature has no properties";
readonly FeatureGeometryNotSupported: "Feature is not Point, LineString or Polygon";
readonly FeatureCoordinatesNotAnArray: "Feature coordinates is not an array";
readonly InvalidModeProperty: "Feature does not have a valid mode property";
};
export declare function hasModeProperty(feature: unknown): feature is {
properties: {
mode: string;
};
};
export declare function isValidTimestamp(timestamp: unknown): boolean;
export declare function isValidStoreFeature(feature: unknown, isValidId: IdStrategy<FeatureId>["isValidId"]): ReturnType<Validation>;