@solid/community-server
Version:
Community Solid Server: an open and modular implementation of the Solid specifications
25 lines (24 loc) • 1.53 kB
TypeScript
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 { PassthroughStore } from './PassthroughStore';
import type { ResourceStore } from './ResourceStore';
/**
* Resource store that slices the data stream if there are range preferences.
* Only works for `bytes` range preferences on binary data streams.
* Does not support multipart range requests.
*
* If the slice happens, unit/start/end values will be written to the metadata to indicate such.
* The values are dependent on the preferences we got as an input,
* as we don't know the actual size of the data stream.
*
* The `defaultSliceSize` parameter can be used to set how large a slice should be if the end of a range is not defined.
* Setting this to 0, which is the default, will cause the end of the stream to be used as the end of the slice.
*/
export declare class BinarySliceResourceStore<T extends ResourceStore = ResourceStore> extends PassthroughStore<T> {
protected readonly logger: import("global-logger-factory").Logger<unknown>;
private readonly defaultSliceSize;
constructor(source: T, defaultSliceSize?: number);
getRepresentation(identifier: ResourceIdentifier, preferences: RepresentationPreferences, conditions?: Conditions): Promise<Representation>;
}