UNPKG

@dstanesc/o-o-o-o-o-o-o

Version:

O-O-O-O-O-O-O is a collection of content addressed persistent data structures

50 lines 2.18 kB
import { BlockStore } from './block-store'; import { LinkCodec, ValueCodec } from './codecs'; import { Graph } from './graph'; import { GraphStore } from './graph-store'; import { Link } from './types'; import { VersionStore } from './version-store'; import { CreateAxiosDefaults } from 'axios'; interface RelayClientPlumbing { storePush(chunkSize: number, bytes: Uint8Array): Promise<PlumbingStorePushResponse>; storePull(chunkSize: number, versionStoreId: string): Promise<Uint8Array | undefined>; storeResolve(versionStoreId: string): Promise<string | undefined>; graphPush(bytes: Uint8Array): Promise<PlumbingGraphPushResponse>; graphPull(versionRoot: string): Promise<Uint8Array | undefined>; indexPull(versionRoot: string): Promise<Uint8Array | undefined>; blocksPush(bytes: Uint8Array): Promise<PlumbingBlocksPushResponse>; blocksPull(links: string[]): Promise<Uint8Array | undefined>; } type PlumbingStorePushResponse = { storeRoot: string; versionRoot: string; }; type PlumbingGraphPushResponse = { versionRoot: string; }; type PlumbingBlocksPushResponse = { blockCount: number; }; type BasicPushResponse = { storeRoot: Link; versionRoot: Link; }; interface RelayClientBasic { push(versionStoreRoot: Link, versionRoot?: Link): Promise<BasicPushResponse>; pull(versionStoreId: string, localVersionStoreRoot?: Link): Promise<{ versionStore: VersionStore; graphStore: GraphStore; graph: Graph; } | undefined>; } declare const relayClientBasicFactory: ({ chunk, chunkSize, linkCodec, valueCodec, blockStore, incremental, }: { chunk: (buffer: Uint8Array) => Uint32Array; chunkSize: number; linkCodec: LinkCodec; valueCodec: ValueCodec; blockStore: BlockStore; incremental?: boolean; }, config: CreateAxiosDefaults<any>) => RelayClientBasic; declare const relayClientPlumbingFactory: (config: CreateAxiosDefaults<any>) => RelayClientPlumbing; export { relayClientPlumbingFactory, RelayClientPlumbing, relayClientBasicFactory, RelayClientBasic, BasicPushResponse, PlumbingGraphPushResponse, PlumbingStorePushResponse, }; //# sourceMappingURL=relay-client.d.ts.map