Only allow content types as relation target (cannot target component)

This commit is contained in:
Convly 2023-09-30 13:31:21 +02:00
parent d010ff3a1e
commit 941b8fdad6

View File

@ -9,7 +9,7 @@ export type Relation<
// It is kept to allow for future iterations without breaking the current type API // It is kept to allow for future iterations without breaking the current type API
_TOrigin extends Common.UID.Schema = Common.UID.Schema, _TOrigin extends Common.UID.Schema = Common.UID.Schema,
TRelationKind extends RelationKind.Any = RelationKind.Any, TRelationKind extends RelationKind.Any = RelationKind.Any,
TTarget extends Common.UID.Schema = Common.UID.Schema TTarget extends Common.UID.ContentType = Common.UID.ContentType
> = Attribute.OfType<'relation'> & > = Attribute.OfType<'relation'> &
// Properties // Properties
Utils.Guard.Never<RelationProperties<TRelationKind, TTarget>, AllRelationProperties<TTarget>> & Utils.Guard.Never<RelationProperties<TRelationKind, TTarget>, AllRelationProperties<TTarget>> &
@ -22,7 +22,7 @@ export type Relation<
export type RelationProperties< export type RelationProperties<
TRelationKind extends RelationKind.Any, TRelationKind extends RelationKind.Any,
TTarget extends Common.UID.Schema TTarget extends Common.UID.ContentType
> = Utils.Expression.MatchFirst< > = Utils.Expression.MatchFirst<
[ [
[ [