@itwin/presentation-components
Version:
React components based on iTwin.js Presentation library
88 lines • 3.38 kB
TypeScript
/** @packageDocumentation
* @module Core
*/
import { PropertyDescription, PropertyRecord } from "@itwin/appui-abstract";
import { EditorDescription, EnumerationInfo, Field, FieldHierarchy, IContentVisitor, Item, ProcessFieldHierarchiesProps, ProcessMergedValueProps, ProcessPrimitiveValueProps, RendererDescription, StartArrayProps, StartCategoryProps, StartContentProps, StartFieldProps, StartItemProps, StartStructProps, TypeDescription } from "@itwin/presentation-common";
/**
* This is merely a copy of `PropertyValueConstraints` from @itwin/presentation-common package to support pre-5.0 version.
* @public
*/
export type PropertyValueConstraints = {
minimumLength?: number;
maximumLength?: number;
} | {
minimumValue?: number;
maximumValue?: number;
} | {
minOccurs?: number;
maxOccurs?: number;
};
/**
* Expands specified type with additional constraints property.
* @public
*/
export type WithConstraints<T extends {}> = T & {
constraints?: PropertyValueConstraints;
};
/** @internal */
export interface FieldInfo {
type: TypeDescription;
name: string;
label: string;
renderer?: RendererDescription;
editor?: EditorDescription;
enum?: EnumerationInfo;
isReadonly?: boolean;
koqName?: string;
constraints?: PropertyValueConstraints;
}
/** @internal */
export declare function createFieldInfo(field: Field, parentFieldName?: string): FieldInfo;
/** @internal */
export declare function createPropertyDescriptionFromFieldInfo(info: FieldInfo): WithConstraints<PropertyDescription>;
/** @internal */
export interface FieldHierarchyRecord {
record: PropertyRecord;
fieldHierarchy: FieldHierarchy;
}
/** @internal */
export interface IPropertiesAppender {
append(record: FieldHierarchyRecord): void;
}
/** @internal */
export interface IRootPropertiesAppender extends IPropertiesAppender {
item: Item;
}
/** @internal */
export interface INestedPropertiesAppender extends IPropertiesAppender {
finish(): void;
}
/** @internal */
export declare namespace IPropertiesAppender {
function isRoot(appender: IPropertiesAppender): appender is IRootPropertiesAppender;
function isNested(appender: IPropertiesAppender): appender is INestedPropertiesAppender;
}
/** @internal */
export declare class InternalPropertyRecordsBuilder implements IContentVisitor {
private _appendersStack;
private _rootAppenderFactory;
private _propertyRecordsProcessor?;
constructor(rootPropertiesAppenderFactory: (item: Item) => IRootPropertiesAppender, propertyRecordsProcessor?: (record: PropertyRecord) => void);
protected get currentPropertiesAppender(): IPropertiesAppender;
startContent(_props: StartContentProps): boolean;
finishContent(): void;
startItem(props: StartItemProps): boolean;
finishItem(): void;
processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void;
startCategory(_props: StartCategoryProps): boolean;
finishCategory(): void;
startField(_props: StartFieldProps): boolean;
finishField(): void;
startStruct(props: StartStructProps): boolean;
finishStruct(): void;
startArray(props: StartArrayProps): boolean;
finishArray(): void;
processMergedValue(props: ProcessMergedValueProps): void;
processPrimitiveValue(props: ProcessPrimitiveValueProps): void;
}
//# sourceMappingURL=ContentBuilder.d.ts.map