From 70dfb94b3fd577e877dfd774c7beb89192bf2512 Mon Sep 17 00:00:00 2001 From: Andrew Chou Date: Wed, 8 Nov 2023 18:10:14 -0500 Subject: [PATCH] feat: add defaultStorage static method to Hypercore --- vendor/hypercore/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vendor/hypercore/index.d.ts b/vendor/hypercore/index.d.ts index befe012..eca8c73 100644 --- a/vendor/hypercore/index.d.ts +++ b/vendor/hypercore/index.d.ts @@ -4,6 +4,7 @@ import { type Duplex, type Readable } from 'streamx' import { type Duplex as NodeDuplex } from 'stream' import type Protomux from 'protomux' import type NoiseStream from '@hyperswarm/secret-stream' +import RandomAccessFile, { RAFOptions } from '../random-access-file' interface RemoteBitfield { get(index: number): boolean @@ -149,6 +150,14 @@ declare class Hypercore< readonly fork: number readonly padding: number static createProtocolStream(stream: boolean | Duplex | NodeDuplex | NoiseStream | ProtocolStream | ReplicationStream | Protomux, opts: CreateProtocolStreamOpts): ReplicationStream + static defaultStorage RandomAccessStorage>(storage: S): S; + static defaultStorage( + storage: string, + opts?: Pick & { + poolSize?: number; + rmdir?: boolean; + unlocked?: boolean; + }): (name: HypercoreStorageName) => RandomAccessFile; constructor(storage: Hypercore.HypercoreStorage) constructor(