import { Readable } from 'stream'; import BitObject from './object'; import { BitObjectList } from './bit-object-list'; import Ref from './ref'; export type ObjectItem = { ref: Ref; buffer: Buffer; type?: string; scope?: string; }; export declare const FETCH_FORMAT_OBJECT_LIST = "ObjectList"; /** * Stream.Readable that operates with objectMode, while each 'data' event emits one ObjectItem object. */ export type ObjectItemsStream = Readable; export declare class ObjectList { objects: ObjectItem[]; constructor(objects?: ObjectItem[]); count(): number; /** * Generates a SHA1 hash from all object buffers. * Used to identify duplicate export requests during retries. * Performance wise, it's not too bad. ~98ms for 150 components on CircleCI. */ getSha1Hash(): string; static mergeMultipleInstances(objectLists: ObjectList[]): ObjectList; mergeObjectList(objectList: ObjectList): void; static fromJsonString(jsonStr: string): ObjectList; toJsonString(): string; toTar(): NodeJS.ReadableStream; toReadableStream(): ObjectItemsStream; static fromTar(packStream: NodeJS.ReadableStream): Promise; static fromTarToObjectStream(packStream: NodeJS.ReadableStream): ObjectItemsStream; static fromObjectStreamToTar(readable: Readable, scopeName: string): any; static fromReadableStream(readable: ObjectItemsStream): Promise; /** * the opposite of this.combineScopeAndHash */ static extractScopeAndHash(name: string): { scope?: string; ref: Ref; }; /** * the opposite of this.extractScopeAndHash */ static combineScopeAndHash(objectItem: ObjectItem): string; addIfNotExist(objectItems: ObjectItem[]): void; toBitObjects(throwForUnknownTypes?: boolean): Promise; static fromBitObjects(bitObjects: BitObject[]): Promise; addScopeName(scopeName: string): void; splitByScopeName(): { [scopeName: string]: ObjectList; }; /** * helps debugging */ toConsoleLog(): void; }