Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/database/src/crossAppContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Enums, type Json } from "./dbTypes";
// An identifier for objects in the platform. Expected to be unique within the platform.
export type LocalId = string;

// A composite identifier for objects in other spaces.
export type Rid = string;

// Common attributes for most types
export type CrossAppBase = {
localId: LocalId;
Expand Down Expand Up @@ -76,3 +79,12 @@ export type CrossAppNode = CrossAppBase & {
full?: InlineCrossAppTypedContent;
};
};

// A relation instance
export type CrossAppRelation = CrossAppBase & {
relationType: LocalId;
/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
source: LocalId | Rid;
destination: LocalId | Rid;
/* eslint-enable @typescript-eslint/no-duplicate-type-constituents */
};