@itwin/core-backend
Version:
iTwin.js backend components
173 lines • 8.91 kB
TypeScript
/** @packageDocumentation
* @module iModels
*/
import { Id64String } from "@itwin/core-bentley";
import { CategoryProps, Code, CodeScopeProps, ElementProps, Rank, SubCategoryAppearance, SubCategoryProps } from "@itwin/core-common";
import { DefinitionElement } from "./Element";
import { IModelDb } from "./IModelDb";
import { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from "./Entity";
/** Defines the appearance for graphics in Geometric elements
* @public @preview
*/
export declare class SubCategory extends DefinitionElement {
static get className(): string;
/** The Appearance parameters for this SubCategory */
appearance: SubCategoryAppearance;
/** Optional description of this SubCategory. */
description?: string;
protected constructor(props: SubCategoryProps, iModel: IModelDb);
/**
* SubCategory custom HandledProps include 'description' and 'properties'.
* @inheritdoc
* @beta
*/
protected static readonly _customHandledProps: CustomHandledProperty[];
/**
* SubCategory deserializes 'description' and 'properties'.
* @inheritdoc
* @beta
*/
static deserialize(props: DeserializeEntityArgs): SubCategoryProps;
/**
* SubCategory serialize 'description' and 'properties'.
* @inheritdoc
* @beta
*/
static serialize(props: SubCategoryProps, iModel: IModelDb): ECSqlRow;
toJSON(): SubCategoryProps;
/** Get the SubCategory's name (its Code value). */
getSubCategoryName(): string;
/** Get the Id of the SubCategory. */
getSubCategoryId(): Id64String;
/** Get the Id of this SubCategory's parent Category. */
getCategoryId(): Id64String;
/** Check if this is the default SubCategory of its parent Category. */
get isDefaultSubCategory(): boolean;
/** Create a Code for a SubCategory given a name that is meant to be unique within the scope of the specified parent Category.
* @param iModel The IModel
* @param parentCategoryId The Id of the parent Category that owns the SubCategory and provides the scope for its name.
* @param codeValue The name of the SubCategory
*/
static createCode(iModel: IModelDb, parentCategoryId: CodeScopeProps, codeValue: string): Code;
/** Create a new SubCategory
* @param iModelDb The iModel
* @param parentCategoryId Create the new SubCategory as a child of this [[Category]]
* @param name The name of the SubCategory
* @param appearance The appearance settings to use for this SubCategory
* @returns The newly constructed SubCategory element.
* @throws [[IModelError]] if unable to create the element.
*/
static create(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): SubCategory;
/** Insert a new SubCategory
* @param iModelDb Insert into this iModel
* @param parentCategoryId Insert the new SubCategory as a child of this Category
* @param name The name of the SubCategory
* @param appearance The appearance settings to use for this SubCategory
* @returns The Id of the newly inserted SubCategory element.
* @throws [[IModelError]] if unable to insert the element.
*/
static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
}
/** A Category element is the target of the `category` member of [[GeometricElement]].
* @public @preview
*/
export declare class Category extends DefinitionElement {
static get className(): string;
rank: Rank;
description?: string;
protected constructor(props: CategoryProps, iModel: IModelDb);
/**
* Category custom HandledProps include 'rank' and 'description'.
* @inheritdoc
* @beta
*/
protected static readonly _customHandledProps: CustomHandledProperty[];
/**
* Category deserializes 'rank' and 'description'.
* @inheritdoc
* @beta
*/
static deserialize(props: DeserializeEntityArgs): CategoryProps;
/**
* Category serialize 'rank' and 'description'.
* @inheritdoc
* @beta
*/
static serialize(props: CategoryProps, iModel: IModelDb): ECSqlRow;
toJSON(): CategoryProps;
/** Get the Id of the default SubCategory for this Category. */
myDefaultSubCategoryId(): Id64String;
/** Set the appearance of the default SubCategory for this Category */
setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void;
}
/** Categorizes 2d GeometricElements.
* @public @preview
*/
export declare class DrawingCategory extends Category {
static get className(): string;
protected constructor(opts: ElementProps, iModel: IModelDb);
/** Get the name of the CodeSpec that is used by DrawingCategory objects. */
static getCodeSpecName(): string;
/** Looks up the CategoryId of a DrawingCategory by model and name */
static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined;
/** Create a Code for a DrawingCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.
* @param iModel The IModel
* @param scopeModelId The Id of the DefinitionModel that contains the DrawingCategory and provides the scope for its name.
* @param codeValue The name of the category
* @return A drawing category Code
*/
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
/** Create a new DrawingCategory
* @param iModelDb The iModel
* @param definitionModelId The [[DefinitionModel]]
* @param name The name of the DrawingCategory
* @returns The newly constructed DrawingCategory element.
* @throws [[IModelError]] if unable to create the element.
*/
static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DrawingCategory;
/** Insert a new DrawingCategory
* @param iModelDb Insert into this iModel
* @param definitionModelId Insert the new DrawingCategory into this [[DefinitionModel]]
* @param name The name of the DrawingCategory
* @param defaultAppearance The appearance settings to use for the default SubCategory of this DrawingCategory
* @returns The Id of the newly inserted DrawingCategory element.
* @throws [[IModelError]] if unable to insert the element.
*/
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
}
/** Categorizes SpatialElements. See [how to create a SpatialCategory]($docs/learning/backend/CreateElements.md#SpatialCategory).
* @public @preview
*/
export declare class SpatialCategory extends Category {
static get className(): string;
protected constructor(opts: ElementProps, iModel: IModelDb);
/** Get the name of the CodeSpec that is used by SpatialCategory objects. */
static getCodeSpecName(): string;
/** Looks up the CategoryId of a SpatialCategory by model and name */
static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined;
/** Create a Code for a SpatialCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.
* @param iModel The IModel
* @param scopeModelId The Id of the DefinitionModel that contains the SpatialCategory and provides the scope for its name.
* @param codeValue The name of the category
* @return A spatial category Code
*/
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
/** Create a new SpatialCategory
* @param iModelDb The iModel
* @param definitionModelId The [[DefinitionModel]]
* @param name The name/CodeValue of the SpatialCategory
* @returns The newly constructed SpatialCategory element.
* @throws [[IModelError]] if unable to create the element.
*/
static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): SpatialCategory;
/** Insert a new SpatialCategory
* @param iModelDb Insert into this iModel
* @param definitionModelId Insert the new SpatialCategory into this DefinitionModel
* @param name The name of the SpatialCategory
* @param defaultAppearance The appearance settings to use for the default SubCategory of this SpatialCategory
* @returns The Id of the newly inserted SpatialCategory element.
* @throws [[IModelError]] if unable to insert the element.
*/
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
}
//# sourceMappingURL=Category.d.ts.map