@itwin/ecschema-metadata
Version:
ECObjects core concepts in typescript
45 lines • 1.7 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Metadata
*/
import { SchemaItemType } from "../ECObjects";
import { ECSchemaError, ECSchemaStatus } from "../Exception";
import { SchemaItem } from "./SchemaItem";
/**
* @public @preview
*/
export class UnitSystem extends SchemaItem {
schemaItemType = UnitSystem.schemaItemType;
/** @internal */
static get schemaItemType() { return SchemaItemType.UnitSystem; }
/**
* Type guard to check if the SchemaItem is of type UnitSystem.
* @param item The SchemaItem to check.
* @returns True if the item is a UnitSystem, false otherwise.
*/
static isUnitSystem(item) {
if (item && item.schemaItemType === SchemaItemType.UnitSystem)
return true;
return false;
}
/**
* Type assertion to check if the SchemaItem is of type UnitSystem.
* @param item The SchemaItem to check.
* @returns The item cast to UnitSystem if it is a UnitSystem, undefined otherwise.
* @internal
*/
static assertIsUnitSystem(item) {
if (!this.isUnitSystem(item))
throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.UnitSystem}' (UnitSystem)`);
}
}
/**
* @internal
* Used for schema editing.
*/
export class MutableUnitSystem extends UnitSystem {
}
//# sourceMappingURL=UnitSystem.js.map