Type Alias AbstractDatastore<TypeName, DocumentResultTypeMap, FindResultTypeMap, UpsertResultTypeMap, UpsertDocumentTypeMap, RemoveResultTypeMap, UpsertResult, LoadResult, FindResult, RemoveResult, DocumentResult, UpsertDocument, ImportResult, BulkImportResult>

AbstractDatastore: {
    countDocuments?: (
        typeName: TypeName,
        query?: Partial<QuerySearch>,
    ) => Promise<number>;
    existsDocument: (typeName: TypeName, entityIRI: string) => Promise<boolean>;
    filterTypedDocument?: <T = any>(
        typeName: TypeName,
        entityIRI: string,
        options?: TypedDocumentFilterOptions<T>,
    ) => Promise<T | null>;
    filterTypedDocuments?: <T = any>(
        typeName: TypeName,
        options?: TypedDocumentsSearchOptions<T>,
    ) => Promise<T[]>;
    findDocuments: <T extends TypeName>(
        typeName: T,
        query: QueryType,
        limit?: number,
        cb?: (
            document: DocumentResultTypeMap[T] extends undefined
                ? DocumentResult
                : DocumentResultTypeMap[T],
        ) => Promise<any>,
    ) => Promise<
        FindResultTypeMap[T] extends undefined
            ? FindResult
            : FindResultTypeMap[T],
    >;
    findDocumentsAsFlatResultSet?: <T extends TypeName>(
        typeName: T,
        query: QueryType,
        limit?: number,
    ) => Promise<any>;
    findDocumentsByAuthorityIRI?: <T extends TypeName>(
        typeName: T,
        authorityIRI: string,
        repositoryIRI?: string,
        limit?: number,
    ) => Promise<
        FindResultTypeMap[T] extends undefined
            ? FindResult
            : FindResultTypeMap[T],
    >;
    findDocumentsByLabel?: <T extends TypeName>(
        typeName: T,
        label: string,
        limit?: number,
    ) => Promise<
        FindResultTypeMap[T] extends undefined
            ? FindResult
            : FindResultTypeMap[T],
    >;
    findEntityByTypeName?: (
        typeName: TypeName,
        searchString: string,
        limit?: number,
    ) => Promise<Entity[]>;
    getClasses?: (entityIRI: string) => Promise<string[]>;
    getEntitiesWithClassesByFilter?: <T = any>(
        options: TypedDocumentsSearchOptions<T>,
    ) => Promise<Map<string, string[]>>;
    importDocument: (
        typeName: TypeName,
        entityIRI: any,
        importStore: AbstractDatastore,
    ) => Promise<ImportResult>;
    importDocuments: (
        typeName: TypeName,
        importStore: AbstractDatastore,
        limit: number,
    ) => Promise<BulkImportResult>;
    iterableImplementation?: AbstractDatastoreIterable<
        TypeName,
        DocumentResultTypeMap,
        DocumentResult,
    >;
    listDocuments: <T extends TypeName>(
        typeName: T,
        limit?: number,
        cb?: (
            document: DocumentResultTypeMap[T] extends undefined
                ? DocumentResult
                : DocumentResultTypeMap[T],
        ) => Promise<any>,
    ) => Promise<
        FindResultTypeMap[T] extends undefined
            ? FindResult
            : FindResultTypeMap[T],
    >;
    loadDocument: <T extends TypeName>(
        typeName: T,
        entityIRI: string,
    ) => Promise<
        DocumentResultTypeMap[T] extends undefined
            ? LoadResult
            : DocumentResultTypeMap[T]
            | undefined
            | null,
    >;
    removeDocument: (
        typeName: TypeName,
        entityIRI: string,
    ) => Promise<RemoveResult>;
    typeIRItoTypeName: IRIToStringFn;
    typeNameToTypeIRI: StringToIRIFn;
    upsertDocument: <T extends TypeName>(
        typeName: T,
        entityIRI: string,
        document: UpsertDocumentTypeMap[T] extends undefined
            ? UpsertDocument
            : UpsertDocumentTypeMap[T],
    ) => Promise<
        UpsertResultTypeMap[T] extends undefined
            ? UpsertResult
            : UpsertResultTypeMap[T],
    >;
}

Type Parameters

Type declaration