@itwin/ecschema-metadata
Version:
ECObjects core concepts in typescript
88 lines • 4.08 kB
TypeScript
/** @packageDocumentation
* @module Metadata
*/
import { KindOfQuantityProps } from "../Deserialization/JsonProps";
import { SchemaItemType } from "../ECObjects";
import { LazyLoadedFormat, LazyLoadedInvertedUnit, LazyLoadedUnit } from "../Interfaces";
import { Format } from "./Format";
import { OverrideFormat } from "./OverrideFormat";
import { SchemaItem } from "./SchemaItem";
/** A Typescript class representation of a KindOfQuantity.
* @public @preview
*/
export declare class KindOfQuantity extends SchemaItem {
readonly schemaItemType: SchemaItemType;
/** @internal */
static get schemaItemType(): SchemaItemType;
private _relativeError;
private _presentationFormats;
private _persistenceUnit?;
/** The first presentation format in the list of Formats. */
get defaultPresentationFormat(): LazyLoadedFormat | OverrideFormat | undefined;
/** A list of presentation formats. */
get presentationFormats(): Array<LazyLoadedFormat | OverrideFormat>;
/** Persistence unit */
get persistenceUnit(): LazyLoadedUnit | LazyLoadedInvertedUnit | undefined;
get relativeError(): number;
/**
*
* @param format The Format to add to this KindOfQuantity
* @param isDefault
* @internal
*/
protected addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault?: boolean): void;
/** Creates an OverrideFormat in the context of this KindOfQuantity.
* @param parent The Format to override.
* @param precision The precision override
* @param unitLabelOverrides The list of unit and label overrides.
* @internal
*/
protected createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;
private processPresentationUnits;
private processPresentationUnitsSync;
/**
* Save this KindOfQuantity's properties to an object for serializing to JSON.
* @param standalone Serialization includes only this object (as opposed to the full schema).
* @param includeSchemaVersion Include the Schema's version information in the serialized object.
*/
toJSON(standalone?: boolean, includeSchemaVersion?: boolean): KindOfQuantityProps;
/** @internal */
toXml(schemaXml: Document): Promise<Element>;
fromJSONSync(kindOfQuantityProps: KindOfQuantityProps): void;
fromJSON(kindOfQuantityProps: KindOfQuantityProps): Promise<void>;
/**
* Used for schema editing.
* @internal
*/
protected setRelativeError(relativeError: number): void;
/**
* Used for schema editing.
* @internal
*/
protected setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;
/**
* Type guard to check if the SchemaItem is of type KindOfQuantity.
* @param item The SchemaItem to check.
* @returns True if the item is a KindOfQuantity, false otherwise.
*/
static isKindOfQuantity(item?: SchemaItem): item is KindOfQuantity;
/**
* Type assertion to check if the SchemaItem is of type KindOfQuantity.
* @param item The SchemaItem to check.
* @returns The item cast to KindOfQuantity if it is a KindOfQuantity, undefined otherwise.
* @internal
*/
static assertIsKindOfQuantity(item?: SchemaItem): asserts item is KindOfQuantity;
}
/**
* @internal
* An abstract class used for schema editing.
*/
export declare abstract class MutableKindOfQuantity extends KindOfQuantity {
abstract addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean): void;
abstract createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;
abstract setDisplayLabel(displayLabel: string): void;
abstract setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;
abstract setRelativeError(relativeError: number): void;
}
//# sourceMappingURL=KindOfQuantity.d.ts.map