mapcomplete/Logic/FeatureSource/FeatureSource.ts

33 lines
840 B
TypeScript
Raw Normal View History

2022-09-08 21:40:48 +02:00
import { Store, UIEventSource } from "../UIEventSource"
import FilteredLayer from "../../Models/FilteredLayer"
import { BBox } from "../BBox"
import { Feature, Geometry } from "@turf/turf"
import { OsmFeature } from "../../Models/OsmFeature"
2021-01-03 00:19:42 +01:00
export default interface FeatureSource {
2022-09-08 21:40:48 +02:00
features: Store<{ feature: OsmFeature; freshness: Date }[]>
/**
* Mainly used for debuging
*/
2022-09-08 21:40:48 +02:00
name: string
}
export interface Tiled {
2022-09-08 21:40:48 +02:00
tileIndex: number
bbox: BBox
}
/**
* A feature source which only contains features for the defined layer
*/
2021-11-07 16:34:51 +01:00
export interface FeatureSourceForLayer extends FeatureSource {
readonly layer: FilteredLayer
}
/**
* A feature source which is aware of the indexes it contains
*/
export interface IndexedFeatureSource extends FeatureSource {
readonly containedIds: Store<Set<string>>
}