mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
feat(hashring): add custom hash function type to algorithm (#43161)
This commit is contained in:
parent
4a852d7a7d
commit
76bb329370
9
types/hashring/index.d.ts
vendored
9
types/hashring/index.d.ts
vendored
@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare namespace HashRing {
|
||||
interface HashRingOptions {
|
||||
/**
|
||||
@ -57,8 +59,11 @@ declare namespace HashRing {
|
||||
}
|
||||
|
||||
declare class HashRing {
|
||||
constructor(servers: HashRing.Servers,
|
||||
algorithm?: string, options?: Partial<HashRing.HashRingOptions>);
|
||||
constructor(
|
||||
servers: HashRing.Servers,
|
||||
algorithm?: string | ((key: string) => string | Buffer),
|
||||
options?: Partial<HashRing.HashRingOptions>,
|
||||
);
|
||||
|
||||
/**
|
||||
* Generates the continuum of server a.k.a as the Hash Ring
|
||||
|
||||
Loading…
Reference in New Issue
Block a user