Class DataType<TDataStore, TTable, TSchemaName, TDoc, TValue>

Type Parameters

  • TDataStore
  • TTable
  • TSchemaName
  • TDoc
  • TValue

Hierarchy

  • TypedEmitter
    • DataType

Constructors

  • Type Parameters

    • TDataStore extends DataStore<"auth" | "config" | "data",
          | "translation"
          | "track"
          | "role"
          | "remoteDetectionAlert"
          | "projectSettings"
          | "preset"
          | "observation"
          | "icon"
          | "field"
          | "deviceInfo"
          | "coreOwnership">
    • TTable extends MapeoDocTables
    • TSchemaName extends
          | "translation"
          | "track"
          | "role"
          | "remoteDetectionAlert"
          | "projectSettings"
          | "preset"
          | "observation"
          | "icon"
          | "field"
          | "deviceInfo"
          | "coreOwnership"
    • TDoc extends
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
    • TValue extends
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}
          | {
              schemaName: TSchemaName;
          } & {}

    Parameters

    • opts: {
          dataStore: TDataStore;
          db: BetterSQLite3Database<Record<string, never>>;
          getTranslations: ((value: {} & {
              docRef: {};
          }) => Promise<{}[]>);
          table: TTable;
      }
      • dataStore: TDataStore
      • db: BetterSQLite3Database<Record<string, never>>
      • getTranslations: ((value: {} & {
            docRef: {};
        }) => Promise<{}[]>)
          • (value): Promise<{}[]>
          • Parameters

            • value: {} & {
                  docRef: {};
              }

            Returns Promise<{}[]>

      • table: TTable

    Returns DataType<TDataStore, TTable, TSchemaName, TDoc, TValue>

Accessors

Methods

  • Parameters

    • docId: string
    • value: Exclude<TValue, {
          schemaName: "coreOwnership";
      }> | CoreOwnershipWithSignaturesValue
    • Optionalopts: {
          checkExisting?: boolean;
      } = {}

      only used internally to skip the checkExisting check when creating a document with a random ID (collisions should be too small probability to be worth checking for)

      • OptionalcheckExisting?: boolean

    Returns Promise<TDoc & {
        forks: string[];
    }>

  • Returns Promise<Omit<SQLiteSelectBase<GetSelectTableName<TTable>, "sync", RunResult, GetSelectTableSelection<TTable>, "single", GetSelectTableName<TTable> extends string
        ? Record<string & GetSelectTableName<TTable>, "not-null">
        : {}, false, never, {
        [K in string]: {
            [Key in string]: SelectResultField<GetSelectTableSelection<(...)>[Key], true>
        }[K]
    }[], BuildSubquerySelection<GetSelectTableSelection<TTable>, GetSelectTableName<TTable> extends string
        ? Record<string & GetSelectTableName<TTable>, "not-null">
        : {}>>, "then" | "catch" | "finally"> & {
        catch?: undefined;
        finally?: undefined;
        then?: undefined;
    }>

  • Type Parameters

    • T extends unknown

    Parameters

    • value: T

    Returns Promise<TDoc & {
        forks: string[];
    }>

  • Parameters

    • docId: string

    Returns Promise<TDoc & {
        forks: string[];
    }>

  • Parameters

    • docId: string
    • Optionaloptions: {
          lang: undefined | string;
          mustBeFound: undefined | true;
      }
      • lang: undefined | string
      • mustBeFound: undefined | true

    Returns Promise<TDoc & {
        forks: string[];
    }>

  • Parameters

    • versionId: string
    • Optionalopts: {
          lang?: string;
      } = {}
      • Optionallang?: string

    Returns Promise<TDoc>

  • Parameters

    • opts: {
          includeDeleted: undefined | boolean;
          lang: undefined | string;
      } = {}
      • includeDeleted: undefined | boolean
      • lang: undefined | string

    Returns Promise<(TDoc & {
        forks: string[];
    })[]>

  • Type Parameters

    • T extends unknown

    Parameters

    • versionId: string | string[]
    • value: T

    Returns Promise<TDoc & {
        forks: string[];
    }>