@solid/community-server
Version:
Community Solid Server: an open and modular implementation of the Solid specifications
36 lines (35 loc) • 2.31 kB
TypeScript
import type { AuxiliaryStrategy } from '../http/auxiliary/AuxiliaryStrategy';
import type { Representation } from '../http/representation/Representation';
import type { RepresentationPreferences } from '../http/representation/RepresentationPreferences';
import type { ResourceIdentifier } from '../http/representation/ResourceIdentifier';
import type { Conditions } from './conditions/Conditions';
import type { RepresentationConverter } from './conversion/RepresentationConverter';
import { PassthroughStore } from './PassthroughStore';
import type { ChangeMap, ResourceStore } from './ResourceStore';
/**
* Store that provides (optional) conversion of incoming and outgoing {@link Representation}s.
*/
export declare class RepresentationConvertingStore<T extends ResourceStore = ResourceStore> extends PassthroughStore<T> {
protected readonly logger: import("global-logger-factory").Logger<unknown>;
private readonly metadataStrategy;
private readonly inConverter;
private readonly outConverter;
private readonly inPreferences;
/**
* @param source - Store we retrieve data from and send data to.
* @param metadataStrategy - Used to distinguish regular resources (which may be converted)
* from metadata resources (which always need conversion).
* @param options - Determines when data should be converted.
* @param options.outConverter - Converts data after retrieval from the source store.
* @param options.inConverter - Converts data before passing to the source store.
* @param options.inPreferences - The preferred input format for the source store, as passed to the inConverter.
*/
constructor(source: T, metadataStrategy: AuxiliaryStrategy, options: {
outConverter?: RepresentationConverter;
inConverter?: RepresentationConverter;
inPreferences?: RepresentationPreferences;
});
getRepresentation(identifier: ResourceIdentifier, preferences: RepresentationPreferences, conditions?: Conditions): Promise<Representation>;
addResource(identifier: ResourceIdentifier, representation: Representation, conditions?: Conditions): Promise<ChangeMap>;
setRepresentation(identifier: ResourceIdentifier, representation: Representation, conditions?: Conditions): Promise<ChangeMap>;
}