r2-shared-js
Version:
Readium 2 'shared' for NodeJS (TypeScript)
17 lines (16 loc) • 1.01 kB
TypeScript
import { Publication } from "../models/publication";
import { Link } from "../models/publication-link";
import { IStreamAndLength } from "r2-utils-js/dist/es8-es2017/src/_utils/zip/zip";
export interface ITransformer {
supports(publication: Publication, link: Link): boolean;
transformStream(publication: Publication, link: Link, url: string | undefined, stream: IStreamAndLength, isPartialByteRangeRequest: boolean, partialByteBegin: number, partialByteEnd: number, sessionInfo: string | undefined): Promise<IStreamAndLength>;
}
export declare class Transformers {
static instance(): Transformers;
static tryStream(publication: Publication, link: Link, url: string | undefined, stream: IStreamAndLength, isPartialByteRangeRequest: boolean, partialByteBegin: number, partialByteEnd: number, sessionInfo: string | undefined): Promise<IStreamAndLength>;
private static _instance;
private transformers;
constructor();
add(transformer: ITransformer): void;
private _tryStream;
}