import { EntityDataset } from "@dclimate/tabular/reader"; /** * Wrap an `EntityDataset` so every method failure -- not just `open`'s -- comes * back as a `DClimateClientError`. * * Translating only at `load` leaves a hole the size of the actual API. `open` * parses a manifest; the errors a caller is far likelier to hit come later, from * `select` on an unknown entity, `where` on a non-comparable column, or `rows` * on a selection that matched nothing. Those are raised inside tabular and, * untranslated, escape as `DatasetReaderError` -- so the one `catch (e) { if (e * instanceof DClimateClientError) }` this library tells people to write misses * precisely the failures they were most likely to be catching for. * * A Proxy rather than a hand-written class of forwarding methods, for two * reasons. Selections return *new* `EntityDataset` instances, so a class would * have to remember to re-wrap the result of every chainable -- and a method * added to tabular later would silently return an unwrapped dataset, reopening * the hole halfway down a chain. And `toQuery`/`plan`/`rows` return plain data * that must pass through untouched; a proxy distinguishes those by what comes * back rather than by a list someone has to keep current. * * That property is doing real work as of tabular 1.0.0, which added `circle`, * `rectangle`, `polygon`, and `geo` -- all sync chainables this file never had to * be told about. * * Three return shapes are handled, because the API has all three: * - sync chainable (`select`, `timeRange`, `where`, `circle`) -> re-wrap * - async chainable (`nearest`) -> re-wrap on resolve * - async terminal (`rows`, `plan`, `listEntities`) -> translate rejection * * `findNearestEntity` is deliberately in the third group, not the second: it * resolves to a plain `NearestEntity` record rather than a dataset, so the * `instanceof` check below lets it through untouched. */ export declare const wrapEntityDataset: (dataset: EntityDataset) => EntityDataset; //# sourceMappingURL=wrap.d.ts.map