@comunica/types
Advanced tools
Comparing version 2.6.11-alpha.41.0 to 2.6.11-alpha.42.0
@@ -5,2 +5,3 @@ /// <reference types="node" /> | ||
import type { AsyncIterator } from 'asynciterator'; | ||
import type { MetadataQuads } from './IMetadata'; | ||
/** | ||
@@ -31,3 +32,9 @@ * A StreamingStore allows data lookup and insertion to happen in parallel. | ||
end: () => void; | ||
/** | ||
* Update the metadata of the base iterator, from which the aggregated store is being populated. | ||
* @param metadata The metadata object. | ||
* @param updateState If the metadata state of derived iterators should be immediately updated. | ||
*/ | ||
setBaseMetadata: (metadata: MetadataQuads, updateStates: boolean) => any; | ||
match: (subject?: RDF.Term | null, predicate?: RDF.Term | null, object?: RDF.Term | null, graph?: RDF.Term | null) => AsyncIterator<Q>; | ||
} |
@@ -8,5 +8,9 @@ import type * as RDF from '@rdfjs/types'; | ||
/** | ||
* The validity state of this metadata object. | ||
*/ | ||
state: IMetadataValidationState; | ||
/** | ||
* An estimate of the number of bindings in the source. | ||
*/ | ||
cardinality: RDF.QueryResultCardinality; | ||
cardinality: QueryResultCardinality; | ||
/** | ||
@@ -58,1 +62,34 @@ * If any of the bindings could contain an undefined variable binding. | ||
export declare type MetadataQuads = IMetadata<RDF.QuadTermName>; | ||
export declare type QueryResultCardinality = RDF.QueryResultCardinality & { | ||
/** | ||
* If this field is set, this means that the cardinality is defined across this whole dataset. | ||
* If this field is not set, then the cardinality is only defined for the current stream. | ||
*/ | ||
dataset?: string; | ||
}; | ||
/** | ||
* Represents the validity of a metadata object. | ||
*/ | ||
export interface IMetadataValidationState { | ||
/** | ||
* If the metadata object is valid. | ||
* | ||
* If it is invalid, the metadata values should be considered outdated, and a new version should be requested. | ||
*/ | ||
valid: boolean; | ||
/** | ||
* Mark the metadta object as invalid. | ||
* | ||
* This will set the `valid` field to false, and invoke the invalidation listeners. | ||
*/ | ||
invalidate: () => void; | ||
/** | ||
* Add an listener that will be invoked when the metadata object becomes invalid. | ||
* | ||
* No expensive operations should be done in these listeners, only other invalidations. | ||
* If other operations should be done, those should be scheduled in next ticks. | ||
* | ||
* @param listener An invalidation listener. | ||
*/ | ||
addInvalidateListener: (listener: () => void) => void; | ||
} |
@@ -23,7 +23,14 @@ import type * as RDF from '@rdfjs/types'; | ||
* Callback that returns a promise that resolves to the metadata about the stream. | ||
* | ||
* This can contain things like the estimated number of total stream elements, | ||
* or the order in which the bindings appear. | ||
* | ||
* This callback can be invoked multiple times. | ||
* The actors that return this metadata will make sure that multiple calls properly cache this promise. | ||
* Each invocation can return a different metadata object, | ||
* if the previous one would have become invalidated (see `metadata.state`). | ||
* The actors that return this metadata will make sure that multiple calls properly cache this promise, | ||
* and that the cached object is properly invalidated if needed. | ||
* Metadata will not be collected until this callback is invoked. | ||
* | ||
* This callback should resolve quickly, so it is safe to call and immediately `await` it. | ||
*/ | ||
@@ -30,0 +37,0 @@ metadata: () => Promise<M>; |
{ | ||
"name": "@comunica/types", | ||
"version": "2.6.11-alpha.41.0", | ||
"version": "2.6.11-alpha.42.0", | ||
"description": "Typings module for Comunica", | ||
@@ -46,3 +46,3 @@ "lsd:module": true, | ||
}, | ||
"gitHead": "6894236da4339c206be19ea5ed7355883bac3992" | ||
"gitHead": "8e8fd82eb1370399248b741602d9b1d46fab2d5d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105137
688