import type { IdentifiedGeoJSONFeature } from "./geojson-types.js"; import type { FeatureId, FeatureSourceListener, ReadonlyFeatureSource, SourceSnapshot } from "./source-types.js"; export type FeatureCollectionInput = { type: "FeatureCollection"; features: TFeature[]; bbox?: number[]; }; export type FeatureSourceInput = TFeature | FeatureCollectionInput | Iterable; export type FeatureUpdate = TFeature | Partial>; /** Reactive, renderer-independent GeoJSON feature storage. */ export declare class FeatureSource implements ReadonlyFeatureSource { #private; constructor(input?: FeatureSourceInput | null); get size(): number; get version(): number; has(id: FeatureId): boolean; get(id: FeatureId): TFeature | undefined; getSnapshot(): SourceSnapshot; /** Return only the feature collection, without the snapshot version. */ getFeatures(): readonly TFeature[]; toGeoJSON(): FeatureCollectionInput; add(feature: TFeature): this; addMany(features: Iterable): this; /** * Shallow-merge a full feature or a patch into an existing id. * Both overloads preserve unspecified optional fields from the current value. */ update(feature: TFeature): this; update(id: FeatureId, update: FeatureUpdate): this; remove(id: FeatureId | Iterable): this; replace(input: FeatureSourceInput): this; clear(): this; /** Run synchronous nested mutations as one versioned `batch` (or `reset`). */ batch(callback: () => void): this; subscribe(listener: FeatureSourceListener): () => void; } export declare function featureSource(input?: FeatureSourceInput | null): FeatureSource; export type { IdentifiedGeoJSONFeature } from "./geojson-types.js"; export type { FeatureId, FeatureSourceChange, FeatureSourceDelta, FeatureSourceListener, ReadonlyFeatureSource, SourceSnapshot } from "./source-types.js"; //# sourceMappingURL=feature-source.d.ts.map