@itwin/ecschema-metadata
Version:
ECObjects core concepts in typescript
77 lines • 3.22 kB
TypeScript
/** @packageDocumentation
* @module Metadata
*/
import { SchemaItemProps } from "../Deserialization/JsonProps";
import { SchemaLoadingController } from "../utils/SchemaLoadingController";
import { SchemaItemType, SupportedSchemaItemType } from "../ECObjects";
import { SchemaItemKey } from "../SchemaKey";
import { Schema } from "./Schema";
/**
* An abstract class that supplies all of the common parts of a SchemaItem.
* @public @preview
*/
export declare abstract class SchemaItem {
/**
* Get the type of item represented by this class
* @internal
*/
static get schemaItemType(): SupportedSchemaItemType;
/**
* Get the type of item represented by this instance
*/
abstract get schemaItemType(): SchemaItemType;
readonly schema: Schema;
private _key;
private _description?;
private _label?;
private _loadingController?;
/** @internal */
constructor(schema: Schema, name: string);
get name(): string;
get fullName(): string;
get key(): SchemaItemKey;
get label(): string | undefined;
get description(): string | undefined;
/**
* Returns the SchemaLoadingController for this Schema. This would only be set if the schema is
* loaded incrementally.
* @internal
*/
get loadingController(): SchemaLoadingController | undefined;
/**
* Save this SchemaItem'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): SchemaItemProps;
/** @internal */
toXml(schemaXml: Document): Promise<Element>;
fromJSONSync(schemaItemProps: SchemaItemProps): void;
fromJSON(schemaItemProps: SchemaItemProps): Promise<void>;
/**
* Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.
* @note The schema name can be a schema alias.
* @param fullName The full name to be parsed.
* @returns A tuple of the parsed Schema name and Schema Item name. If the full name does not contain a '.' or ':', the second string in the tuple will returned the exact string pass in.
*/
static parseFullName(fullName: string): [string, string];
/**
* Indicates if the two SchemaItem objects are equal by comparing their respective [[key]] properties.
* @param thisSchemaItem The first SchemaItem.
* @param thatSchemaItemOrKey The second SchemaItem or SchemaItemKey.
*/
static equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItem | SchemaItemKey): boolean;
/**
* @internal
*/
static isSchemaItem(item: unknown): item is SchemaItem;
/** @internal */
protected setName(name: string): void;
/** @internal */
protected setDisplayLabel(displayLabel: string): void;
/** @internal */
protected setDescription(description: string): void;
/** @internal */
setLoadingController(controller: SchemaLoadingController): void;
}
//# sourceMappingURL=SchemaItem.d.ts.map