@dxos/halo
    Preparing search index...

    Interface ServiceApi

    The service shape backing Service. Named (rather than inline in the Context.Tag) so consumers referencing it — e.g. a capability typed Context.Service.Shape<typeof Space.Service> — name it portably instead of expanding its structure and leaking the transitive Invitation types into their declaration emit (TS2883).

    interface ServiceApi {
        create: (
            options?: CreateOptions,
        ) => Effect<
            { id: SpaceId; name?: string; state: "inactive"
            | "closed"
            | "ready" },
            SpaceError,
        >;
        export: (id: SpaceId) => Effect<Archive, SpaceError>;
        get: (
            id: SpaceId,
        ) => Effect<
            Option<
                { id: SpaceId; name?: string; state: "inactive"
                | "closed"
                | "ready" },
            >,
        >;
        import: (
            archive: Archive,
            options?: { tags?: readonly string[] },
        ) => Effect<
            { id: SpaceId; name?: string; state: "inactive"
            | "closed"
            | "ready" },
            SpaceError,
        >;
        invitations: (id: SpaceId) => Stream<readonly Flow[]>;
        join: (code: string) => Effect<Flow, SpaceError>;
        members: (
            id: SpaceId,
        ) => Stream<
            readonly {
                data?: { readonly [key: string]: any };
                did?: IdentityDid;
                displayName?: string;
                identityKey?: string;
                online: boolean;
                role: "pull" | "read" | "edit" | "admin";
            }[],
        >;
        removeMember: (
            id: SpaceId,
            subject: IdentityDid,
        ) => Effect<void, SpaceError>;
        setEdgeReplication: (
            id: SpaceId,
            setting: "disabled" | "enabled",
        ) => Effect<void, SpaceError>;
        share: (id: SpaceId, options?: ShareOptions) => Effect<Flow, SpaceError>;
        spaces: Stream<
            readonly {
                id: SpaceId;
                name?: string;
                state: "inactive"
                | "closed"
                | "ready";
            }[],
        >;
        updateMemberRole: (
            id: SpaceId,
            subject: IdentityDid,
            role: "pull" | "read" | "edit" | "admin",
        ) => Effect<void, SpaceError>;
        waitReady: (id: SpaceId) => Effect<void, SpaceError>;
    }
    Index

    Properties

    create: (
        options?: CreateOptions,
    ) => Effect<
        { id: SpaceId; name?: string; state: "inactive"
        | "closed"
        | "ready" },
        SpaceError,
    >

    Create a new space.

    export: (id: SpaceId) => Effect<Archive, SpaceError>

    Export a space to an archive.

    get: (
        id: SpaceId,
    ) => Effect<
        Option<
            { id: SpaceId; name?: string; state: "inactive"
            | "closed"
            | "ready" },
        >,
    >

    Resolve a space by id.

    import: (
        archive: Archive,
        options?: { tags?: readonly string[] },
    ) => Effect<
        { id: SpaceId; name?: string; state: "inactive"
        | "closed"
        | "ready" },
        SpaceError,
    >

    Import a space from an archive.

    invitations: (id: SpaceId) => Stream<readonly Flow[]>

    A space's active (host-created) invitation flows; emits the current set immediately.

    join: (code: string) => Effect<Flow, SpaceError>

    Redeem a space-invitation code (guest side).

    members: (
        id: SpaceId,
    ) => Stream<
        readonly {
            data?: { readonly [key: string]: any };
            did?: IdentityDid;
            displayName?: string;
            identityKey?: string;
            online: boolean;
            role: "pull" | "read" | "edit" | "admin";
        }[],
    >

    A space's membership; emits the current set immediately, then on join/leave/role/presence.

    removeMember: (id: SpaceId, subject: IdentityDid) => Effect<void, SpaceError>

    Remove a member (Keyhive revocation).

    setEdgeReplication: (
        id: SpaceId,
        setting: "disabled" | "enabled",
    ) => Effect<void, SpaceError>

    Enable or disable EDGE replication for a space.

    share: (id: SpaceId, options?: ShareOptions) => Effect<Flow, SpaceError>

    Initiate a space invitation (host side).

    spaces: Stream<
        readonly {
            id: SpaceId;
            name?: string;
            state: "inactive"
            | "closed"
            | "ready";
        }[],
    >

    All spaces known to the local identity as a stream that emits the current set immediately on subscription. Take the first element for a one-shot read; subscribe for updates.

    updateMemberRole: (
        id: SpaceId,
        subject: IdentityDid,
        role: "pull" | "read" | "edit" | "admin",
    ) => Effect<void, SpaceError>

    Change a member's access level (Keyhive delegation).

    waitReady: (id: SpaceId) => Effect<void, SpaceError>

    Resolve once the space has reached the ready state.