import type { UnitsProvider } from "./Interfaces"; /** * Options for [[createUnitsProvider]]. * @beta */ export interface CreateUnitsProviderOptions { /** * A `UnitsProvider` consulted before the basic BIS units (e.g. a `SchemaUnitProvider` * for an open iModel's `SchemaContext`). When omitted, the returned provider behaves * exactly like `new BasicUnitsProvider()`. */ primary?: UnitsProvider; /** * Controls which provider is consulted first and wins ties. * - `"preferSchema"` (default): `primary` is authoritative; bundled BIS units are fallback. * - `"preferBundled"`: bundled BIS units win; `primary` is consulted only for units not in * the bundled set. Use when the iModel's schema may be stale. * * Affects `findUnit`, `findUnitByName`, and `getConversion` (first-consulted wins or * falls through). `getUnitsByFamily` always merges both providers — the first-consulted * provider wins name collisions. * * Has no effect when `primary` is omitted — the returned provider is a plain `BasicUnitsProvider`. */ bisUnitsPolicy?: "preferSchema" | "preferBundled"; } /** * Returns a `UnitsProvider` that layers the basic BIS units under (or over) an optional * `primary` provider. Typical use: layer an iModel's schema units on top of the bundled * defaults from `@itwin/core-quantity`. * * Precedence rules: * - When `primary` is supplied and `bisUnitsPolicy` is `"preferSchema"` (the default): `primary` wins; * basic BIS units fill any gaps where `primary` returns an invalid unit or throws. * - When `bisUnitsPolicy` is `"preferBundled"`: basic BIS units win; `primary` is consulted only when the * basic provider can't answer. * - `getUnitsByFamily` always merges results from both providers, deduplicated by * `UnitProps.name` (fully-qualified). The first-consulted provider wins ties. * - When no `primary` is supplied, the returned provider is exactly `new BasicUnitsProvider()` * (no wrapper), preserving `instanceof` checks and keeping the hot path fast. * * @beta */ export declare function createUnitsProvider(options?: CreateUnitsProviderOptions): UnitsProvider; //# sourceMappingURL=CompositeUnitsProvider.d.ts.map