Fix model (#546)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2021-12-06 22:16:09 +07:00 committed by GitHub
parent 570f373af7
commit 3648d63547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -14,7 +14,7 @@
//
import type { IntlString } from '@anticrm/platform'
import type { Account, AnyAttribute, AttachedDoc, Class, ClassifierKind, Doc, Domain, Mixin, Obj, Ref, Space, Timestamp, Type } from '@anticrm/core'
import type { Account, AnyAttribute, AttachedDoc, Class, ClassifierKind, Doc, Domain, Mixin, Obj, Ref, Space, Timestamp, Type, Collection, RefTo } from '@anticrm/core'
import { DOMAIN_MODEL } from '@anticrm/core'
import { Model, Prop, TypeTimestamp } from '@anticrm/model'
import core from './component'
@ -70,6 +70,16 @@ export class TType extends TObj implements Type<any> {
@Model(core.class.TypeString, core.class.Type)
export class TTypeString extends TType {}
@Model(core.class.RefTo, core.class.Type)
export class TRefTo extends TType implements RefTo<Doc> {
to!: Ref<Class<Doc>>
}
@Model(core.class.Collection, core.class.Type)
export class TCollection extends TType implements Collection<AttachedDoc> {
of!: Ref<Class<Doc>>
}
@Model(core.class.TypeBoolean, core.class.Type)
export class TTypeBoolean extends TType {}

View File

@ -15,7 +15,7 @@
import { Builder } from '@anticrm/model'
import core from './component'
import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString, TTypeBoolean, TTypeTimestamp, TTypeDate, TAttachedDoc } from './core'
import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString, TTypeBoolean, TTypeTimestamp, TTypeDate, TAttachedDoc, TCollection, TRefTo } from './core'
import { TSpace, TAccount, TState, TSpaceWithStates, TDocWithState } from './security'
import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD, TTxPutBag, TTxRemoveDoc, TTxBulkWrite, TTxCollectionCUD } from './tx'
@ -49,6 +49,8 @@ export function createModel (builder: Builder): void {
TTypeString,
TTypeBoolean,
TTypeTimestamp,
TRefTo,
TCollection,
TTypeDate,
TState
)