-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e345246
commit 33f193b
Showing
5 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
// Type definitions for @farcaster/rocksdb 3.0 | ||
// Project: https://github.com/farcasterxyz/rocksdb | ||
// Definitions by: Meirion Hughes <https://github.com/MeirionHughes> | ||
// Daniel Byrne <https://github.com/danwbyrne> | ||
// Paul Fletcher-Hill <https://github.com/pfletcherhill> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
|
||
/// <reference types="node" /> | ||
|
||
// If we ever start using the upstream rocksdb package again, remove this | ||
// wrapper `module` declaration. It's only needed because our forked package is | ||
// scoped to @farcaster. | ||
declare module "@farcaster/rocksdb" { | ||
import { | ||
AbstractBatch, | ||
AbstractChainedBatch, | ||
AbstractGetOptions, | ||
AbstractIterator, | ||
AbstractIteratorOptions, | ||
AbstractLevelDOWN, | ||
AbstractOpenOptions, | ||
AbstractOptions, | ||
ErrorCallback, | ||
ErrorValueCallback, | ||
} from "abstract-leveldown"; | ||
|
||
interface RocksDB extends AbstractLevelDOWN<RocksDB.Bytes, RocksDB.Bytes> { | ||
open(cb: ErrorCallback): void; | ||
open(options: RocksDB.OpenOptions, cb: ErrorCallback): void; | ||
|
||
get(key: RocksDB.Bytes, cb: ErrorValueCallback<RocksDB.Bytes>): void; | ||
get( | ||
key: RocksDB.Bytes, | ||
options: RocksDB.GetOptions, | ||
cb: ErrorValueCallback<RocksDB.Bytes> | ||
): void; | ||
|
||
put(key: RocksDB.Bytes, value: RocksDB.Bytes, cb: ErrorCallback): void; | ||
put( | ||
key: RocksDB.Bytes, | ||
value: RocksDB.Bytes, | ||
options: RocksDB.PutOptions, | ||
cb: ErrorCallback | ||
): void; | ||
|
||
del(key: RocksDB.Bytes, cb: ErrorCallback): void; | ||
del( | ||
key: RocksDB.Bytes, | ||
options: RocksDB.DelOptions, | ||
cb: ErrorCallback | ||
): void; | ||
|
||
batch(): AbstractChainedBatch<RocksDB.Bytes, RocksDB.Bytes>; | ||
batch( | ||
array: AbstractBatch[], | ||
cb: ErrorCallback | ||
): AbstractChainedBatch<RocksDB.Bytes, RocksDB.Bytes>; | ||
batch( | ||
array: AbstractBatch[], | ||
options: RocksDB.BatchOptions, | ||
cb: ErrorCallback | ||
): AbstractChainedBatch<RocksDB.Bytes, RocksDB.Bytes>; | ||
|
||
approximateSize( | ||
start: RocksDB.Bytes, | ||
end: RocksDB.Bytes, | ||
cb: RocksDB.ErrorSizeCallback | ||
): void; | ||
compactRange( | ||
start: RocksDB.Bytes, | ||
end: RocksDB.Bytes, | ||
cb: ErrorCallback | ||
): void; | ||
getProperty(property: string): string; | ||
iterator(options?: RocksDB.IteratorOptions): RocksDB.Iterator; | ||
} | ||
|
||
namespace RocksDB { | ||
type Bytes = string | Buffer; | ||
type ErrorSizeCallback = (err: Error | undefined, size: number) => void; | ||
type OpenOptions = AbstractOpenOptions; | ||
|
||
interface GetOptions extends AbstractGetOptions { | ||
fillCache?: boolean | undefined; | ||
} | ||
|
||
interface PutOptions extends AbstractOptions { | ||
sync?: boolean | undefined; | ||
} | ||
|
||
interface DelOptions extends AbstractOptions { | ||
sync?: boolean | undefined; | ||
} | ||
|
||
interface BatchOptions extends AbstractOptions { | ||
sync?: boolean | undefined; | ||
} | ||
|
||
interface IteratorOptions extends AbstractIteratorOptions<Bytes> { | ||
fillCache?: boolean | undefined; | ||
} | ||
|
||
interface Iterator extends AbstractIterator<Bytes, Bytes> { | ||
seek(key: Bytes): void; | ||
binding: any; | ||
cache: any; | ||
finished: any; | ||
fastFuture: any; | ||
} | ||
|
||
interface Constructor { | ||
new (location: string): RocksDB; | ||
(location: string): RocksDB; | ||
destroy(location: string, cb: ErrorCallback): void; | ||
repair(location: string, cb: ErrorCallback): void; | ||
} | ||
} | ||
|
||
const RocksDB: RocksDB.Constructor; | ||
export default RocksDB; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -979,6 +979,15 @@ | |
"@ethersproject/properties" "^5.7.0" | ||
"@ethersproject/strings" "^5.7.0" | ||
|
||
"@farcaster/[email protected]": | ||
version "5.5.0" | ||
resolved "https://registry.yarnpkg.com/@farcaster/rocksdb/-/rocksdb-5.5.0.tgz#c352480a7d6e08c2eee8e1690dc0a49e5a72c8fd" | ||
integrity sha512-E5xavqAOrS9yXV2zw2lEyv7j4w1jZd0UNtsi5C9tqk5Kw9voCojA/zTgb5WugEqHAT6Bt/szahhnNuWxbo9NPg== | ||
dependencies: | ||
abstract-leveldown "^7.2.0" | ||
napi-macros "^2.0.0" | ||
node-gyp-build "^4.3.0" | ||
|
||
"@fastify/ajv-compiler@^3.5.0": | ||
version "3.5.0" | ||
resolved "https://registry.yarnpkg.com/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz#459bff00fefbf86c96ec30e62e933d2379e46670" | ||
|