@anticrm/core Package
Classes
Class | Description |
---|---|
Model | Model is a storage for Class descriptors and useful functions to match class instances to queries and apply values to them based on changes. |
TxProcessor |
Enumerations
Enumeration | Description |
---|---|
ClassifierKind | |
SortingOrder | |
TxContextSource |
Functions
Function | Description |
---|---|
combineStorage(storages) | Return a combined storage |
generateId() | |
isValidSelector(selector) | |
mixinFromKey(key) | |
mixinKey(mixin, key) | |
txContext(source, network) | Return a complete TxContext |
Interfaces
Interface | Description |
---|---|
AnyLayout | |
ArrayOf | |
Attribute | |
AttributeMatch | |
BagOf | |
Classifier | |
CoreProtocol | |
Doc | |
DocumentProtocol | |
DomainIndex | |
EClass | |
EDomainClassifier | |
EEnum | |
Emb | |
EMixin | |
EnumLiteral | |
EnumOf | |
FindOptions | Some options used to perform find opertion. |
Indices | |
InstanceOf | |
Obj | |
RefTo | |
RegExpression | |
Storage_2 | |
Tx | Transaction operation being processed. |
TxContext | Define a transaction processing context. |
Type |
Variables
Variable | Description |
---|---|
CORE_CLASS_ARRAY_OF | |
CORE_CLASS_ATTRIBUTE | |
CORE_CLASS_BAG_OF | |
CORE_CLASS_BOOLEAN | |
CORE_CLASS_CLASS | |
CORE_CLASS_DOC | |
CORE_CLASS_EMB | |
CORE_CLASS_ENUM_OF | |
CORE_CLASS_ENUM | |
CORE_CLASS_INSTANCE_OF | |
CORE_CLASS_MIXIN | |
CORE_CLASS_NUMBER | |
CORE_CLASS_OBJ | |
CORE_CLASS_REF_TO | |
CORE_CLASS_STRING | |
CORE_CLASS_TYPE | |
CORE_MIXIN_INDICES | |
MODEL_DOMAIN |
Type Aliases
Type Alias | Description |
---|---|
AllAttributes | |
ArrayQueryType | |
Attributes | |
BooleanProperty | |
Class | |
DateProperty | |
DocumentQuery | A possible query values to be used with Document access protocol.It allows to pass individual values with matched type to T. In case of Arrays it is possible o match entire array with partial fields or to match an element in array if object is specified as query. |
DocumentSorting | |
DocumentSortingValueRaw | |
DocumentValue | |
DocumentValueRaw | |
Enum | |
EnumKey | |
EnumLiterals | |
Mixin | |
NumberProperty | |
ObjQueryType | |
PrimitiveType | |
Property | |
PropertyType | |
Ref | |
StringProperty | |
TSortingWithoutEmbArray | |
TWithoutEmbArray |
Enumerations
ClassifierKind enum
Signature:
export declare enum ClassifierKind
Enumeration Members
Member | Value | Description |
---|---|---|
CLASS | 0 |
|
ENUM | 2 |
|
MIXIN | 1 |
SortingOrder enum
Signature:
export declare enum SortingOrder
Enumeration Members
Member | Value | Description |
---|---|---|
Ascending | 1 |
|
Descending | -1 |
TxContextSource enum
Signature:
export declare enum TxContextSource
Enumeration Members
Member | Value | Description |
---|---|---|
Client | 0 |
|
Server | 1 |
|
ServerTransient | 2 |
Functions
combineStorage
Return a combined storage
Signature:
export declare function combineStorage(...storages: Storage[]): Storage;
Parameters
Parameter | Type | Description |
---|---|---|
storages | Storage[] |
Returns:
Storage
generateId
Signature:
export declare function generateId(): Ref<Doc>;
Returns:
isValidSelector
Signature:
export declare function isValidSelector(selector: ObjectSelector[]): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
selector | ObjectSelector[] |
Returns:
boolean
mixinFromKey
Signature:
export declare function mixinFromKey(key: string): {
mixin: Ref<Mixin<Obj>>;
key: string;
};
Parameters
Parameter | Type | Description |
---|---|---|
key | string |
Returns:
{ mixin: Ref<Mixin<Obj>>; key: string; }
mixinKey
Signature:
export declare function mixinKey(mixin: Ref<Mixin<Obj>>, key: string): string;
Parameters
Parameter | Type | Description |
---|---|---|
mixin | Ref<Mixin<Obj>> | |
key | string |
Returns:
string
txContext
Return a complete TxContext
Signature:
export declare function txContext(source?: TxContextSource, network?: Promise<void>): TxContext;
Parameters
Parameter | Type | Description |
---|---|---|
source | TxContextSource | |
network | Promise |
Returns:
Variables
CORE_CLASS_ARRAY_OF
Signature:
CORE_CLASS_ARRAY_OF: Ref<Class<ArrayOf>>
CORE_CLASS_ATTRIBUTE
Signature:
CORE_CLASS_ATTRIBUTE: Ref<Class<Attribute>>
CORE_CLASS_BAG_OF
Signature:
CORE_CLASS_BAG_OF: Ref<Class<BagOf>>
CORE_CLASS_BOOLEAN
Signature:
CORE_CLASS_BOOLEAN: Ref<Class<Type>>
CORE_CLASS_CLASS
Signature:
CORE_CLASS_CLASS: Ref<Class<Class<Obj>>>
CORE_CLASS_DOC
Signature:
CORE_CLASS_DOC: Ref<Class<Doc>>
CORE_CLASS_EMB
Signature:
CORE_CLASS_EMB: Ref<Class<Emb>>
CORE_CLASS_ENUM_OF
Signature:
CORE_CLASS_ENUM_OF: Ref<Class<EnumOf<EnumKey>>>
CORE_CLASS_ENUM
Signature:
CORE_CLASS_ENUM: Ref<Class<Enum<any>>>
CORE_CLASS_INSTANCE_OF
Signature:
CORE_CLASS_INSTANCE_OF: Ref<Class<InstanceOf<Emb>>>
CORE_CLASS_MIXIN
Signature:
CORE_CLASS_MIXIN: Ref<Class<Mixin<Obj>>>
CORE_CLASS_NUMBER
Signature:
CORE_CLASS_NUMBER: Ref<Class<Type>>
CORE_CLASS_OBJ
Signature:
CORE_CLASS_OBJ: Ref<Class<Obj>>
CORE_CLASS_REF_TO
Signature:
CORE_CLASS_REF_TO: Ref<Class<RefTo<Doc>>>
CORE_CLASS_STRING
Signature:
CORE_CLASS_STRING: Ref<Class<Type>>
CORE_CLASS_TYPE
Signature:
CORE_CLASS_TYPE: Ref<Class<Type>>
CORE_MIXIN_INDICES
Signature:
CORE_MIXIN_INDICES: Ref<Mixin<Indices>>
MODEL_DOMAIN
Signature:
MODEL_DOMAIN = "model"
Type Aliases
AllAttributes
Signature:
export declare type AllAttributes<T extends E, E extends Obj> = Required<Attributes<T, E>> & Partial<Attributes<E, Obj>>;
ArrayQueryType
Signature:
export declare type ArrayQueryType<A> = A extends Array<infer T> ? ObjQueryType<T> | Array<ObjQueryType<T>> : ObjQueryType<A>;
Attributes
Signature:
export declare type Attributes<T extends E, E extends Obj> = Record<Exclude<keyof T, keyof E>, Attribute>;
BooleanProperty
Signature:
export declare type BooleanProperty = Property<boolean, boolean>;
Class
Signature:
export declare type Class<T extends Obj> = EClass<T, Obj>;
DateProperty
Signature:
export declare type DateProperty = Property<number, Date>;
DocumentQuery
A possible query values to be used with Document access protocol.
It allows to pass individual values with matched type to T. In case of Arrays it is possible o match entire array with partial fields or to match an element in array if object is specified as query.
Signature:
export declare type DocumentQuery<T> = {
[P in keyof T]?: ArrayQueryType<T[P]>;
};
DocumentSorting
Signature:
export declare type DocumentSorting<T> = T extends Obj ? DocumentSortingValueRaw<T> : SortingOrder;
DocumentSortingValueRaw
Signature:
export declare type DocumentSortingValueRaw<T> = {
[P in keyof T]?: TSortingWithoutEmbArray<T[P]>;
};
DocumentValue
Signature:
export declare type DocumentValue<T> = T extends Doc ? DocumentValueRaw<Omit<T, keyof Doc>> : never | T extends Emb ? DocumentValueRaw<Omit<T, keyof Emb>> : never | T extends Obj ? T : T;
DocumentValueRaw
Signature:
export declare type DocumentValueRaw<T> = {
[P in keyof T]: TWithoutEmbArray<T[P]>;
};
Enum
Signature:
export declare type Enum<T extends EnumKey> = EEnum<T, EnumLiteral>;
EnumKey
Signature:
export declare type EnumKey = string | number | symbol;
EnumLiterals
Signature:
export declare type EnumLiterals<T extends EnumKey, E extends EnumLiteral> = {
[Q in T]: E;
};
Mixin
Signature:
export declare type Mixin<T extends Obj> = EMixin<T, Obj>;
NumberProperty
Signature:
export declare type NumberProperty = Property<number, number>;
ObjQueryType
Signature:
export declare type ObjQueryType<T> = T extends Obj ? DocumentQuery<T> : T | RegExpression;
PrimitiveType
Signature:
export declare type PrimitiveType = number | string | boolean | undefined;
Property
Signature:
export declare type Property<P extends PrimitiveType, T> = P & {
__property: T;
};
PropertyType
Signature:
export declare type PropertyType = Property<PrimitiveType, any> | Ref<Doc> | Emb | PropertyType[] | {
[key: string]: PropertyType;
};
Ref
Signature:
export declare type Ref<T extends Doc> = string & {
__ref: T;
};
StringProperty
Signature:
export declare type StringProperty = Property<string, string>;
TSortingWithoutEmbArray
Signature:
export declare type TSortingWithoutEmbArray<A> = A extends Array<infer T> ? DocumentSorting<T> : DocumentSorting<A>;
TWithoutEmbArray
Signature:
export declare type TWithoutEmbArray<A> = A extends Array<infer T> ? Array<DocumentValue<T>> : DocumentValue<A>;