declare namespace datasources { type TEventData = import('~shared/hooks/use-events/interfaces').webforms.WEvent; type TDatasourceType = | 'auto' | 'entity' | 'entitysel' | 'catalog' | 'dataclass' | 'scalar' | 'array' | 'object'; type TJSType = 'string' | 'number' | 'bool' | 'date' | 'object' | 'array'; type TDataType = | 'array' | 'bool' | 'string' | 'text' | 'uuid' | 'short' | 'long' | 'number' | 'long64' | 'duration' | 'object' | 'date' | 'image'; interface IEnhancedCatalog extends ICatalog { dataClasses: IDataClasses; dataClassByCollectionName: IDataClasses; singletons: ISingletons; } interface ICollection { __COUNT: number; __DATACLASS: string; __FIRST: number; __GlobalStamp: number; __SENT: string; __entityModel: string; __ENTITIES: T[]; __ENTITYSET?: string; __MAXENTITIES?: number; __queryPlan?: any; __extendedQueryPlan?: any; __extendedQueryPath?: any; } interface IBaseAttribute { name: string; kind: AttributeKind; scope: Scope; exposed?: boolean; readOnly?: boolean; } interface ISimpleAttribute extends IBaseAttribute { type: AttributeType; indexed?: boolean; identifying?: boolean; simpleDate?: boolean; } interface IRelatedEntitiesAttribute extends IBaseAttribute { kind: 'relatedEntities'; path: string; type: AttributeType | string; inverseName: string; reversePath: boolean; } interface IRelatedEntityAttribute extends IBaseAttribute { kind: 'relatedEntity'; type: AttributeType | string; path: string; foreignKey: string; inverseName: string; } interface ICalculatedAttribute extends IBaseAttribute { kind: 'calculated'; type: AttributeType | string; foreignKey?: string; inverseName?: string; reversePath?: boolean; path?: string; behavior?: 'relatedEntities' | 'relatedEntity'; } interface IAliasAttribute extends IBaseAttribute { behavior?: 'relatedEntities' | 'relatedEntity'; type: AttributeType | string; foreignKey?: string; inverseName?: string; reversePath?: boolean; path?: string; kind: 'alias'; } type IAttribute = { name: string; type: string; kind: EAttributeKind; scope: AttributeScope; uuid?: string; } & Partial<{ indexKind: TIndexType; autogenerate: boolean; unique: boolean; primKey: boolean; exposed: boolean; behavior: string; autosequence: boolean; reversePath: boolean; not_null: boolean; minValue: number; maxValue: number; simpleDate: boolean; defaultValue: any; events: any[]; path: string; extraProperties: IAttributeProperties; styled_text: boolean; }>; interface IRelatedAttribute extends IBaseAttribute { type?: AttributeType | string; behavior: 'relatedEntities' | 'relatedEntity'; foreignKey?: string; inverseName?: string; path?: string; reversePath?: boolean; } interface IEntity { __KEY?: string; __TIMESTAMP?: Date; __STAMP?: number; } type TSingletonMethod = Partial; interface ISingletonClass { name: string; methods: ISingletonMethod[]; } interface ICatalog { __UNIQID: string; __BASEID: string; methods: catalog.IMethod[]; dataClasses: IDetailedDataClass[]; singletons?: ISingletonClass[]; } interface IDataClass { name: string; uri: string; dataURI: string; } interface IDetailedDataClass extends IDataClass { className: string; collectionName: string; tableNumber: number; scope: Scope; attributes?: IAttribute[]; key: IDataClassKey[]; methods: catalog.IMethod[]; exposed?: boolean; extraProperties?: IAttributeProperties; virtual?: boolean; uuid?: string; } type IDataClasses = { [key: string]: IDetailedDataClass }; type ISingletons = { [key: string]: ISingletonClass }; class AttributeFilter { addAttribute(attname: string, subfilter?: any): void; mergeWith(mergeWith: { filter: any }): void; addFilterText(filterText: string, newprop: string): string; buildString(curpath: string): string; } interface IDSChildren { [datasourceName: string]: DataSource; } interface INameSpace { sources: IDSChildren; root: DataSource; } type ICreateDataSource = | ICreateDataSourceScalar | ICreateDataSourceArray | ICreateDataSourceObject | ICreateDataSourceEntity | ICreateDataSourceEntitySelection; type IEntityDatasource = | datasources.ICreateDataSourceEntity | datasources.ICreateDataSourceEntitySelection; interface ICreateDataSourceCommon { id: string; initialValue: any; events?: webforms.WEvent[]; namespace: string; schema?: { type: string; properties: { name: string; type: string; initialValue: any }[]; }; } interface ICreateDataSourceCommon { id: string; initialValue: any; events?: webforms.WEvent[]; namespace: string; schema?: { type: string; properties: { name: string; type: string; initialValue: any }[]; }; } interface ICreateDataSourceArray extends ICreateDataSourceCommon { id: string; type: 'scalar'; initialValue: any[] | null; dataType: 'array'; from?: string; } interface ICreateDataSourceObject extends ICreateDataSourceCommon { type: 'scalar'; initialValue: object | null; dataType: 'object'; from?: string; } interface ICreateDataSourceEntity extends ICreateDataSourceCommon { type: 'entity'; initialValue: 'first' | 'empty' | ''; dataclass: string; depth: number | null; from?: string; dataType?: string; } interface ICreateDataSourceEntitySelection extends ICreateDataSourceCommon { type: 'entitysel'; initialValue: 'all' | ''; from?: string; dataclass: string; depth: number | null; pageSize: number | null; dataType?: string; } interface IDSMethods { [key: string]: catalog.IMethod; } class DataSource { id: string; alias: string; type: TDatasourceType; namespace: string; stamp: number; frozenStamp: number; inited: boolean; beeingResolved: boolean; fromServerStorage: boolean; canBeUpdatedByParent: boolean; local: boolean; parentSource: this; dataType: TJSType; dataclass: datasources.DataClass; dataclassID: string; parendId: string; children: IDSChildren; initialValue: string | null; properyInParent?: string; filterAttributes?: AttributeFilter; filterAttributesText?: string; constructor(namespace: string, id: string, type: string); static spaces: { [namespace: string]: INameSpace; }; static globalStamp: number; static anonymCount: number; static dataTypeMap: { bool: 'bool'; string: 'string'; text: 'string'; uuid: 'string'; short: 'number'; long: 'number'; number: 'number'; long64: 'number'; duration: 'number'; object: 'object'; date: 'date'; }; static removeSource(id: string, namespace?: string): void; static getOrBuildNameSpace(namespace?: string): INameSpace; static getNameSpace(namespace: string): INameSpace; static buildSource( sourcestr: string, initialValue: any, ds: DataStore, namespace: string, ): void; static create( settings: ICreateDataSource, ds: DataStore, namespace?: string, ): DataSource; static getSourceAttributes( id: string, options?: any, namespace?: string, ): IDataClassAttribute[]; static buildCatalogDatasources( datastore: datasources.DataStore, namespace?: string, ); isLocal(): boolean; setLocal(local: boolean): void; buildCallFuncURL( methodName: string, added: string, ): string | Promise; buildEntitySettings(existingSettings?: any): any; buildSelectionSettings(existingSettings?: any): any; fireEvent(eventType: string, data?: any): void; addListener(eventType: string, callback: Function): void; removeListener(eventType: string, callback: Function): void; getValue(property?: string | number, settings?: any): Promise; findElementPosition(elementDataSource: DataSource): Promise; getCollection( index: number, howmany: number, propertyStr: string, ): Promise; orderBy(attrs: string, settings?: any): Promise; query(queryStr: string, settings?: any): Promise; getValueAsParam(property?: string, settings?: any): Promise; getDataType(): null; setValue( property: string | null, value: T, doFireEvent?: boolean, ): Promise; setValueFromMethodResult(resp: any, doFireEvent?: boolean): Promise; clone(): null; refresh(doFireEvent?: boolean): Promise; recompute(fireEvent?: boolean): Promise; recomputeChildren(doFireEvent?: boolean): Promise; addAttributeFilter(child: this): void; static createRequestOptimization(ns?: string): void; formatValue(value: any): typeof value; getStamp(): number; getPageSize(): number; touch(): void; getParentSource(): this; getDataClass(): DataClass; getProperyInParent(): string; freezeStamp(withChildren: boolean): void; modifiedSinceLastFreeze(): boolean; dumpTree(curtext: string, level: number): string; init(): void; filterAttributesText?: string; callAction?(action: string, meta?: any): void; getMethods(): IDSMethods; copyValueInto(source: any, fireEvent?: boolean): Promise; static getSource(id: string, namespace?: string): DataSource | undefined; static getSource(id: string, namespace?: string): DataSource | undefined; static getSourceOrBuild( id: string | null, initialValue: any, ds: DataStore, namespace?: string, ): DataSource; static AddAlias(id: string, datasource: DataSource, namespace?: string); static buildDependencies(namespace?: string): void; static computeInitialValues(namespace?: string): void; static refreshNamespace(namespace?: string): void; static getAllSources(namespace?: string): IDSChildren | {}; } }