stores
    Preparing search index...

    Interface Blockstore<HasOptionsExtension, PutOptionsExtension, PutManyOptionsExtension, GetOptionsExtension, GetManyOptionsExtension, GetAllOptionsExtension, DeleteOptionsExtension, DeleteManyOptionsExtension>

    interface Blockstore<
        HasOptionsExtension = {},
        PutOptionsExtension = {},
        PutManyOptionsExtension = {},
        GetOptionsExtension = {},
        GetManyOptionsExtension = {},
        GetAllOptionsExtension = {},
        DeleteOptionsExtension = {},
        DeleteManyOptionsExtension = {},
    > {
        delete(
            key: CID,
            options?: AbortOptions & DeleteOptionsExtension,
        ): Await<void>;
        deleteMany(
            source: AwaitIterable<CID<unknown, number, number, Version>>,
            options?: AbortOptions & DeleteManyOptionsExtension,
        ): AwaitIterable<CID<unknown, number, number, Version>>;
        get(
            key: CID,
            options?: AbortOptions & GetOptionsExtension,
        ): Await<Uint8Array<ArrayBufferLike>>;
        getAll(
            options?: AbortOptions & GetAllOptionsExtension,
        ): AwaitIterable<Pair>;
        getMany(
            source: AwaitIterable<CID<unknown, number, number, Version>>,
            options?: AbortOptions & GetManyOptionsExtension,
        ): AwaitIterable<Pair>;
        has(key: CID, options?: AbortOptions & HasOptionsExtension): Await<boolean>;
        put(
            key: CID,
            val: Uint8Array,
            options?: AbortOptions & PutOptionsExtension,
        ): Await<CID<unknown, number, number, Version>>;
        putMany(
            source: AwaitIterable<Pair>,
            options?: AbortOptions & PutManyOptionsExtension,
        ): AwaitIterable<CID<unknown, number, number, Version>>;
    }

    Type Parameters

    • HasOptionsExtension = {}
    • PutOptionsExtension = {}
    • PutManyOptionsExtension = {}
    • GetOptionsExtension = {}
    • GetManyOptionsExtension = {}
    • GetAllOptionsExtension = {}
    • DeleteOptionsExtension = {}
    • DeleteManyOptionsExtension = {}

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Check for the existence of a value for the passed key

      Parameters

      Returns Await<boolean>

      const exists = await store.has(new Key('awesome'))

      if (exists) {
      console.log('it is there')
      } else {
      console.log('it is not there')
      }