mapcomplete/Logic/FeatureSource/FeatureSource.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
840 B
TypeScript
Raw Normal View History

import { Store, UIEventSource } from "../UIEventSource"
import FilteredLayer from "../../Models/FilteredLayer"
import { BBox } from "../BBox"
2022-07-13 17:56:10 +02:00
import { Feature, Geometry } from "@turf/turf"
import { OsmFeature } from "../../Models/OsmFeature"
2021-01-03 00:19:42 +01:00
export default interface FeatureSource {
2022-07-13 17:56:10 +02:00
features: Store<{ feature: OsmFeature; freshness: Date }[]>
/**
* Mainly used for debuging
*/
name: string
}
export interface Tiled {
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>>
}