@anticrm/model Package

Packages > @anticrm/model

Classes

List of classes contained in this package or namespace
Class Description
Builder

Functions

List of functions contained in this package or namespace
Function Description
ArrayOf$() Mark attribute as collection, if attribute already had type, it will be wrapped inside.
BagOf$()
Class$(id, _extends, domain)
extendIds(a, b)
getAttribute(target, propertyKey)
getClassifier(target)
InstanceOf$(of)
mergeIds(a, b)
Mixin$(id, _extends)
Primary()
Prop(type) Construct a property
RefTo$(to)
verifyTranslation(ids, translations)

Variables

List of variables contained in this package or namespace
Variable Description
modelIds

Functions

ArrayOf$

Mark attribute as collection, if attribute already had type, it will be wrapped inside.

Signature:

export declare function ArrayOf$(): (target: any, propertyKey: string) => void;

Returns:

(target: any, propertyKey: string) => void

BagOf$

Signature:

export declare function BagOf$(): (target: any, propertyKey: string) => void;

Returns:

(target: any, propertyKey: string) => void

Class$

Signature:

export declare function Class$<E extends Obj, T extends E>(id: Ref<Class<T>>, _extends: Ref<Class<E>>, domain?: string): <C extends new () => T>(constructor: C) => void;

Parameters

List of parameters
Parameter Type Description
id Ref<Class>
_extends Ref<Class>
domain string

Returns:

<C extends new () => T>(constructor: C) => void

extendIds

Signature:

export declare function extendIds<P extends Service, X extends PluginDependencies, D extends PluginDescriptor<P, X>, N extends Namespace>(a: D, b: N): D & N;

Parameters

List of parameters
Parameter Type Description
a D
b N

Returns:

D & N

getAttribute

Signature:

export declare function getAttribute(target: any, propertyKey: string): Attribute;

Parameters

List of parameters
Parameter Type Description
target any
propertyKey string

Returns:

Attribute

getClassifier

Signature:

export declare function getClassifier(target: any): Classifier<Obj>;

Parameters

List of parameters
Parameter Type Description
target any

Returns:

Classifier<Obj>

InstanceOf$

Signature:

export declare function InstanceOf$<T extends Emb>(of: Ref<Class<T>>): (target: any, propertyKey: string) => void;

Parameters

List of parameters
Parameter Type Description
of Ref<Class>

Returns:

(target: any, propertyKey: string) => void

mergeIds

Signature:

export declare function mergeIds<A extends PluginIds, B extends PluginIds>(a: A, b: B): A & B;

Parameters

List of parameters
Parameter Type Description
a A
b B

Returns:

A & B

Mixin$

Signature:

export declare function Mixin$<E extends Obj, T extends E>(id: Ref<Mixin<T>>, _extends: Ref<Classifier<E>>): <C extends new () => T>(constructor: C) => void;

Parameters

List of parameters
Parameter Type Description
id Ref<Mixin>
_extends Ref<Classifier>

Returns:

<C extends new () => T>(constructor: C) => void

Primary

Signature:

export declare function Primary(): (target: any, propertyKey: string) => void;

Returns:

(target: any, propertyKey: string) => void

Prop

Construct a property

Signature:

export declare function Prop(type?: Ref<Class<Type>>): (target: any, propertyKey: string) => void;

Parameters

List of parameters
Parameter Type Description
type Ref<Class<Type>>

Returns:

(target: any, propertyKey: string) => void

RefTo$

Signature:

export declare function RefTo$(to: Ref<Class<Doc>>): (target: any, propertyKey: string) => void;

Parameters

List of parameters
Parameter Type Description
to Ref<Class<Doc>>

Returns:

(target: any, propertyKey: string) => void

verifyTranslation

Signature:

export declare function verifyTranslation<T extends StringIds>(ids: T, translations: AsStrings<T>): {
    [key: string]: string;
};

Parameters

List of parameters
Parameter Type Description
ids T
translations AsStrings

Returns:

{ [key: string]: string; }

Variables

modelIds

Signature:

modelIds: {
    class: {
        Obj: Ref<Class<Obj>>;
        Emb: Ref<Class<Emb>>;
        Doc: Ref<Class<Doc>>;
        Classifier: Ref<Class<Classifier<Obj>>>;
        Attribute: Ref<Class<Attribute>>;
        Class: Ref<Class<Class<Obj>>>;
        Mixin: Ref<Class<Mixin<Obj>>>;
        Type: Ref<Class<Type>>;
        String: Ref<Class<Type>>;
        Number: Ref<Class<Type>>;
        Boolean: Ref<Class<Type>>;
        ArrayOf: Ref<Class<ArrayOf>>;
        RefTo: Ref<Class<RefTo<Doc>>>;
        BagOf: Ref<Class<BagOf>>;
        InstanceOf: Ref<Class<InstanceOf<Type>>>;
    };
    mixin: {
        Indices: Ref<Mixin<Indices>>;
    };
}