datastore-core
Version:
Wrapper implementation for interface-datastore
30 lines • 1.02 kB
TypeScript
import type { Shard } from './index.js';
import type { Datastore } from 'interface-datastore';
export declare const PREFIX = "/repo/flatfs/shard/";
export declare const SHARDING_FN = "SHARDING";
export declare class ShardBase implements Shard {
param: number;
name: string;
_padding: string;
constructor(param: number);
fun(s: string): string;
toString(): string;
}
export declare class Prefix extends ShardBase {
constructor(prefixLen: number);
fun(noslash: string): string;
}
export declare class Suffix extends ShardBase {
constructor(suffixLen: number);
fun(noslash: string): string;
}
export declare class NextToLast extends ShardBase {
constructor(suffixLen: number);
fun(noslash: string): string;
}
/**
* Convert a given string to the matching sharding function
*/
export declare function parseShardFun(str: string): Shard;
export declare const readShardFun: (path: string | Uint8Array, store: Datastore) => Promise<Shard>;
//# sourceMappingURL=shard.d.ts.map