ECClass Class @preview

A common abstract class for all of the ECClass types.

Extends

Extended by

Implements

Methods

Name Description
fromJSON(classProps: ClassProps): Promise<void>    
fromJSONSync(classProps: ClassProps): void    
getAllBaseClasses(): AsyncIterable<ECClass> Iterates (recursively) over all base classes and mixins, in "property override" order.  
getAllBaseClassesSync(): Iterable<AnyClass>    
getBaseClassSync(): ECClass | undefined    
getCustomAttributes(): Promise<CustomAttributeSet> Retrieve all custom attributes in the current class and its bases  
getCustomAttributesSync(): CustomAttributeSet Retrieve all custom attributes in the current class and its bases.  
getDerivedClasses(): Promise<ECClass[] | undefined> Gets the derived classes belonging to this class.  
getInheritedProperty(name: string): Promise<Property | undefined> Searches the base class, if one exists, for the property with the name provided.  
getInheritedPropertySync(name: string): Property | undefined Searches the base class, if one exists, for the property with the name provided.  
getProperties(excludeInherited?: boolean): Promise<Iterable<Property, any, any>> Returns the properties on this class and its base classes.  
getPropertiesSync(excludeInherited?: boolean): Iterable<Property> Returns the properties on this class and its base classes.  
getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on  
getPropertySync(name: string, excludeInherited?: boolean): Property | undefined Searches, case-insensitive, for a local ECProperty with the name provided.  
is(targetClass: ECClass): Promise<boolean> Indicates if the targetClass is of this type.  
is(targetClass: string, schemaName: string): Promise<boolean> Indicates if the targetClass is of this type.  
isSync(targetClass: ECClass): boolean A synchronous version of the ECClass.is, indicating if the targetClass is of this type.  
isSync(targetClass: string, schemaName: string): boolean A synchronous version of the ECClass.is, indicating if the targetClass is of this type.  
toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps Save this Classes properties to an object for serializing to JSON.  
traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback  
traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback  

Inherited methods

Name Inherited from Description
equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItemKey | SchemaItem): boolean Static Inherited SchemaItem Indicates if the two SchemaItem objects are equal by comparing their respective key properties.
parseFullName(fullName: string): [string, string] Static Inherited SchemaItem Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.

Properties

Name Type Description
baseClass Accessor ReadOnly LazyLoadedECClass | undefined Gets the base class if it exists, otherwise returns undefined.  
customAttributes Accessor ReadOnly CustomAttributeSet | undefined    
hasLocalProperties Accessor ReadOnly boolean Quick way to check whether this class has any local properties without having to use the iterable  
modifier Accessor ReadOnly ECClassModifier    

Inherited properties

Name Type Inherited from Description
description Accessor Inherited ReadOnly string | undefined SchemaItem  
fullName Accessor Inherited ReadOnly string SchemaItem  
key Accessor Inherited ReadOnly SchemaItemKey SchemaItem  
label Accessor Inherited ReadOnly string | undefined SchemaItem  
name Accessor Inherited ReadOnly string SchemaItem  
schema Readonly Inherited Schema SchemaItem  
schemaItemType Accessor Abstract Inherited ReadOnly SchemaItemType SchemaItem Get the type of item represented by this instance

Defined in

Last Updated: 16 May, 2026