Class DataStore<TNamespace, TSchemaName>

Type Parameters

Hierarchy

  • TypedEmitter
    • DataStore

Constructors

  • Type Parameters

    • TNamespace extends "auth" | "config" | "data" = "auth" | "config" | "data"
    • TSchemaName extends
          | "translation"
          | "track"
          | "role"
          | "remoteDetectionAlert"
          | "projectSettings"
          | "preset"
          | "observation"
          | "icon"
          | "field"
          | "deviceInfo"
          | "coreOwnership" = {
          auth: readonly ["coreOwnership", "role"];
          config: readonly ["translation", "preset", "field", "projectSettings", "deviceInfo", "icon"];
          data: readonly ["observation", "track", "remoteDetectionAlert"];
      }[TNamespace][number]

    Parameters

    Returns DataStore<TNamespace, TSchemaName>

Accessors

  • get indexer(): MultiCoreIndexer<"binary">
  • Returns MultiCoreIndexer<"binary">

  • get schemas(): ("track" | "remoteDetectionAlert" | "observation")[] | (
        | "translation"
        | "projectSettings"
        | "preset"
        | "icon"
        | "field"
        | "deviceInfo")[] | ("role" | "coreOwnership")[]
  • Returns ("track" | "remoteDetectionAlert" | "observation")[] | (
        | "translation"
        | "projectSettings"
        | "preset"
        | "icon"
        | "field"
        | "deviceInfo")[] | ("role" | "coreOwnership")[]

Methods

  • Returns Promise<void>

  • Parameters

    • versionId: string

    Returns Promise<MapeoDoc>

  • Parameters

    • versionId: string

    Returns Promise<Buffer>

  • Unlink all index files. This should only be called after close() has resolved.

    Returns Promise<void>

  • UNSAFE: Does not check links: [] refer to a valid doc - should only be used internally.

    Write a doc, must be one of the schema types supported by the namespace of this DataStore.

    Type Parameters

    • TDoc extends
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{} & CoreOwnershipSignatures, "versionId" | "originalVersionId" | "links"> & {}
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{}, "versionId">
          | {
              schemaName: TSchemaName;
          } & Omit<{} & CoreOwnershipSignatures, "versionId">

    Parameters

    Returns Promise<
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>
        | Extract<{}, TDoc>>

  • Parameters

    • buf: Buffer

    Returns Promise<string>