@dxos/echo
    Preparing search index...

    Variable Ref

    Ref: {
        <S extends AnyObj>(type: S): RefSchema<InstanceType<S> & Obj.Unknown>;
        <S extends AnyRelation>(
            type: S,
        ): RefSchema<InstanceType<S> & Relation.Unknown>;
        <T extends Type.Type<any>>(type: T): RefSchema<InstanceType<T>>;
        <S extends UnknownTypeSchema<any, any>>(
            schema: S,
        ): RefSchema<Type<S> & Obj.Unknown>;
    }

    Factory function to create a Ref schema for the given target schema. Use this in schema definitions to declare reference fields.

    Type declaration

    class Task extends Type.makeObject<Task>(DXN.make('com.example.type.task', '0.1.0'))(
    Schema.Struct({
    assignee: Ref.Ref(Person), // Creates a Ref schema
    }),
    ) {}

    O(1) per call at schema-definition time; reads the target type annotation.