@dxos/echo
    Preparing search index...

    Interface Hypergraph

    Manages cross-space database interactions.

    interface Hypergraph {
        query: QueryFn;
        get defaultBlobStorage(): string;
        get registry(): Registry.Registry;
        createRefResolver(options: RefResolverOptions): RefResolver;
        getDatabase(spaceId: Key.SpaceId): undefined | Database.Database;
        makeRef<T extends Entity.Unknown = Entity.Unknown>(
            uri: URI.URI,
        ): Ref.Ref<T>;
        registerBlobBackend(
            name: string,
            backend: BlobBackend,
            options?: { default?: boolean },
        ): CleanupFn;
    }

    Hierarchy (View Summary)

    Index

    Properties

    query: QueryFn

    Query objects.

    O(AST size) to key the result cache; returns a shared, lazily executed result, so nothing runs until read.

    Accessors

    • get defaultBlobStorage(): string

      Storage name Blob.fromBytes uses when its storage option is omitted. Starts as 'inline'; reflects the most recent registerBlobBackend(name, backend, { default: true }) call.

      Returns string

    Methods

    • Creates a reference to an existing object in the database.

      NOTE: The reference may be dangling if the object is not present in the database. NOTE: Difference from Ref.fromURI Ref.fromURI(dxn) returns an unhydrated reference. The .load and .target APIs will not work. db.makeRef(dxn) is preferable in cases with access to the database.

      Type Parameters

      Parameters

      Returns Ref.Ref<T>

      O(1); allocates a resolver-bound ref without looking the target up.

    • Registers a pluggable blob storage backend under name, claiming its declared URI schemes. Registering a scheme already claimed by another backend is an error.

      Parameters

      • name: string
      • backend: BlobBackend
      • Optionaloptions: { default?: boolean }
        • Optionaldefault?: boolean

          When true, name becomes the storage used when Blob.fromBytes's storage option is omitted.

      Returns CleanupFn

      A cleanup function that unregisters the backend.

      O(s) in the backend URI schemes.