From 9720f1b6238772e4daa553fc4058c1257f9c5f40 Mon Sep 17 00:00:00 2001 From: Jampard Date: Fri, 2 Sep 2022 19:01:06 +0200 Subject: [PATCH 1/6] Support AutoBee --- README.md | 24 ++ autobee.js | 86 ++++ index.js | 2 +- package.json | 10 +- test_autobee.js | 1048 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1165 insertions(+), 5 deletions(-) create mode 100644 autobee.js create mode 100644 test_autobee.js diff --git a/README.md b/README.md index 4436f7f..4496c92 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # hyperbeedeebee + A MongoDB-like database built on top of Hyperbee with support for indexing Based on [this design](https://gist.github.com/RangerMauve/ae271204054b62d9a649d70b7d218191) @@ -59,6 +60,28 @@ const killbots = await db.collection('example') const eggbert = await db.collection('example').findOne({name: 'Eggbert'}) ``` +### Usage with Autobase + +```JavaScript + const input = new Hypercore(RAM) + const output = new Hypercore(RAM) + const inputs = [input] + + const base = new Autobase({ + inputs, + localOutput: firstOutput, + localInput: firstUser + }) + const autobee = new SimpleAutobee(base) + + // Create a new DB + const db = new DB(autobee) + // You can then use the DB the same way as you did above. +``` + +You also need to use the [Autobee class](./autobee.js): +This class redefines the functions of Hyperbee to be compatible with the DB. + ## Data Types HyperbeeDeeBee uses MongoDB's [BSON](https://github.com/mongodb/js-bson) data types for encoding data. @@ -87,6 +110,7 @@ BSONRegExp, BSONSymbol, Timestamp ``` + ## Important Differences From MongoDB - There is a single writer for a hyperbee and multiple readers diff --git a/autobee.js b/autobee.js new file mode 100644 index 0000000..18e1ca9 --- /dev/null +++ b/autobee.js @@ -0,0 +1,86 @@ +const Hyperbee = require('hyperbee') +const b4a = require('b4a') + +module.exports = class SimpleAutobee { + constructor (autobase, opts) { + this.autobase = autobase + this.opts = opts + if (!opts?.sub) { + this.autobase.start({ + unwrap: true, + apply: applyAutobeeBatch, + view: (core) => + new Hyperbee(core.unwrap(), { + ...this.opts, + extension: false + }) + }) + this.bee = this.autobase.view + } + } + + ready () { + return this.autobase.ready() + } + + feed () { + return this.bee.feed + } + + close () { + return this.bee.close() + } + + sub (name) { + const opts = this.opts ?? {} + opts.sub = true + const auto = new SimpleAutobee(this.autobase, opts) + auto.bee = this.bee.sub(name) + return auto + } + + batch () { + return this + } + + flush () { } + + async put (key, value, opts = {}) { + const op = b4a.from( + JSON.stringify({ type: 'put', key, value, prefix: this.bee.prefix }) + ) + return await this.autobase.append(op) + } + + async del (key, opts = {}) { + const op = b4a.from( + JSON.stringify({ type: 'del', key, prefix: this.bee.prefix }) + ) + return await this.autobase.append(op) + } + + async get (key) { + return await this.bee.get(key) + } + + createReadStream (opts) { + return this.bee.createReadStream(opts) + } +} + +function getKeyBufferWithPrefix (key, prefix) { + return prefix ? b4a.concat([b4a.from(prefix), b4a.from(key)]) : b4a.from(key) +} +// A real apply function would need to handle conflicts, beyond last-one-wins. +async function applyAutobeeBatch (bee, batch) { + const b = bee.batch({ update: false }) + for (const node of batch) { + const op = JSON.parse(node.value.toString()) + const bufKey = getKeyBufferWithPrefix(op.key, op.prefix) + if (op.type === 'put') { + await b.put(bufKey, b4a.from(op.value)) + } + if (op.type === 'del') await b.del(bufKey) + } + await b.flush() +} diff --git a/index.js b/index.js index 707aac0..e11fb2d 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,7 @@ class DB { async close () { // TODO: This looks kinda stange. PR a close method on bee? - return this.bee.feed.close() + return this.bee.close() } } diff --git a/package.json b/package.json index 96d65f9..0d61c1f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "lint": "standard --fix", - "test": "npm run lint && node ./test.js" + "test": "npm run lint && node ./test.js && node ./test_autobee.js" }, "repository": { "type": "git", @@ -29,9 +29,11 @@ "cbor": "^8.1.0" }, "devDependencies": { - "hyperbee": "^1.5.4", - "hypercore": "^9.9.1", - "random-access-memory": "^3.1.2", + "autobase": "https://github.com/hypercore-protocol/autobase", + "b4a": "^1.6.0", + "hyperbee": "^2.0.0", + "hypercore": "^10.2.0", + "random-access-memory": "^5.0.0", "standard": "^16.0.3", "tape": "^5.2.2" } diff --git a/test_autobee.js b/test_autobee.js new file mode 100644 index 0000000..7240e17 --- /dev/null +++ b/test_autobee.js @@ -0,0 +1,1048 @@ +const test = require('tape') +const RAM = require('random-access-memory') +const Hypercore = require('hypercore') +const Autobase = require('autobase') +const HyperbeeDeeBee = require('./') +const SimpleAutobee = require('./autobee') +const { DB } = HyperbeeDeeBee + +function getBee () { + const firstUser = new Hypercore(RAM) + const firstOutput = new Hypercore(RAM) + const inputs = [firstUser] + + const base1 = new Autobase({ + inputs, + localOutput: firstOutput, + localInput: firstUser + }) + return new SimpleAutobee(base1) +} +// eslint-disable-next-line no-unused-vars +function getBees () { + const firstUser = new Hypercore(RAM) + const firstOutput = new Hypercore(RAM) + const secondUser = new Hypercore(RAM) + const secondOutput = new Hypercore(RAM) + + const inputs = [firstUser, secondUser] + + const base1 = new Autobase({ + inputs, + localOutput: firstOutput, + localInput: firstUser + }) + const base2 = new Autobase({ + inputs, + localOutput: secondOutput, + localInput: secondUser + }) + + return [new SimpleAutobee(base1), new SimpleAutobee(base2)] +} + +test('Create a document in a collection', async (t) => { + const db = new DB(getBee()) + try { + const collection = db.collection('example') + + t.equal(collection.name, 'example', 'Collection created') + + const doc = await collection.insert({ example: 'Hello World!' }) + + t.ok(doc?._id, 'Doc got created along with _id') + + const otherDoc = await collection.findOne({ _id: doc._id }) + + t.equal(otherDoc.example, doc.example, 'DB property got loaded') + + t.end() + } finally { + await db.close() + } +}) + +test('Create documents with sparse props', async (t) => { + const db = new DB(getBee()) + try { + const collection = db.collection('example') + + await collection.insert({ example: 'World' }) + await collection.insert({ example: 'Hello', color: 'red' }) + + const doc = await collection.findOne({ color: 'red' }) + + t.equal(doc.color, 'red') + + t.end() + } finally { + await db.close() + } +}) + +test('Iterate through all docs in a db', async (t) => { + const db = new DB(getBee()) + + try { + const doc1 = await db.collection('example').insert({ example: 'Hello' }) + const doc2 = await db.collection('example').insert({ example: 'World' }) + + const docs = await db.collection('example').find() + + t.equal(docs.length, 2, 'Found both docs') + + let isFirst = true + for await (const doc of db.collection('example').find()) { + if (isFirst) { + t.ok(doc._id.equals(doc1._id), 'Got same id when iterating (1)') + isFirst = false + } else { + t.ok(doc._id.equals(doc2._id), 'Got same id when iterating (2)') + } + } + + t.end() + } finally { + await db.close() + } +}) +test('Iterate through different collections', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').insert({ example: 'Hello' }) + await db.collection('example').insert({ example: 'World' }) + + const doc1 = await db.collection('patras').insert({ example: 'Hello' }) + const doc2 = await db.collection('patras').insert({ example: 'World' }) + + const docs = await db.collection('patras').find() + + t.equal(docs.length, 2, 'Found both docs') + + let isFirst = true + for await (const doc of db.collection('patras').find()) { + if (isFirst) { + t.ok(doc._id.equals(doc1._id), 'Got same id when iterating (1)') + isFirst = false + } else { + t.ok(doc._id.equals(doc2._id), 'Got same id when iterating (2)') + } + } + + t.end() + } finally { + await db.close() + } +}) + +test('Iterate through different collections of different base', async (t) => { + const [base1, base2] = getBees() + const db = new DB(base1) + const db2 = new DB(base2) + + try { + // await db.collection('example').insert({ example: 'Hello' }) + // await db.collection('example').insert({ example: 'World' }) + + const doc1 = await db.collection('patras').insert({ example: 'Hello' }) + const doc2 = await db.collection('patras').insert({ example: 'World' }) + + const docs = await db2.collection('patras').find() + + t.equal(docs.length, 2, 'Found both docs') + + let isFirst = true + for await (const doc of db2.collection('patras').find()) { + if (isFirst) { + t.ok(doc._id.equals(doc1._id), 'Got same id when iterating (1)') + isFirst = false + } else { + t.ok(doc._id.equals(doc2._id), 'Got same id when iterating (2)') + } + } + + t.end() + } finally { + await db.close() + } +}) +test('Limit and Skip', async (t) => { + const db = new DB(getBee()) + const NUM_TO_MAKE = 30 + let i = NUM_TO_MAKE + try { + while (i--) { + await db.collection('example').insert({ i }) + } + + const found = await db.collection('example').find().skip(10).limit(10) + + t.equal(found.length, 10, 'Got expected number of items') + + const onlyIs = found.map(({ i }) => i) + + const expected = [19, 18, 17, 16, 15, 14, 13, 12, 11, 10] + + t.deepEqual(onlyIs, expected, 'Got expected subset of Ids') + + t.end() + } finally { + await db.close() + } +}) + +test('Search by field equal', async (t) => { + const db = new DB(getBee()) + + try { + const doc1 = await db.collection('example').insert({ example: 'Hello' }) + const doc2 = await db + .collection('example') + .insert({ example: ['Hello', 'World'] }) + await db.collection('example').insert({ example: 'World' }) + + const found = await db.collection('example').find({ example: 'Hello' }) + + t.equal(found.length, 2, 'Found 2 documents') + t.ok(doc1._id.equals(found[0]._id), 'Got matched field document') + t.ok(doc2._id.equals(found[1]._id), 'Got matched array field document') + + t.end() + } finally { + await db.close() + } +}) + +test('Search by number fields', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').insert({ example: 4 }) + await db.collection('example').insert({ example: 20 }) + await db.collection('example').insert({ example: 666 }) + await db.collection('example').insert({ example: 9001 }) + + const found1 = await db.collection('example').find({ + example: { + $gte: 10, + $lte: 20 + } + }) + + t.equal(found1.length, 1, 'Found 1 document >= 10 and <= 20') + + const found2 = await db.collection('example').find({ + example: { + $gt: 9000 + } + }) + + t.equal(found2.length, 1, 'Found 1 document > 9000') + + const found3 = await db.collection('example').find({ + example: { + $lt: 10 + } + }) + + t.equal(found3.length, 1, 'Found 1 document < 10') + + // const found4 = await db.collection('example').find({ + // example: { + // $ne: 666 + // } + // }) + + // t.equal(found4.length, 3, 'Found 3 document =! 666') + + t.end() + } finally { + await db.close() + } +}) + +test('Search by date fields', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').insert({ example: new Date(2000, 0) }) + await db.collection('example').insert({ example: new Date(2000, 2) }) + await db.collection('example').insert({ example: new Date(2000, 6) }) + await db.collection('example').insert({ example: new Date(2000, 11) }) + + const found1 = await db.collection('example').find({ + example: { + $gte: new Date(2000, 1), + $lte: new Date(2000, 6) + } + }) + + t.equal(found1.length, 2, 'Found 2 document >= Feb and <= July') + + t.end() + } finally { + await db.close() + } +}) + +test('Search using $in and $all', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').insert({ example: [1, 3, 5, 7, 9] }) + await db.collection('example').insert({ example: [2, 3, 6, 8, 10] }) + await db.collection('example').insert({ example: 1 }) + await db.collection('example').insert({ example: 2 }) + + const found1 = await db.collection('example').find({ + example: { + $in: [1, 3, 8] + } + }) + + t.equal(found1.length, 3, 'Found 3 matching documents') + + const found2 = await db.collection('example').find({ + example: { + $all: [2, 6, 8] + } + }) + + t.equal(found2.length, 1, 'Found 1 matching document') + + t.end() + } finally { + await db.close() + } +}) + +test('Search using $exists', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').insert({ example: 'wow' }) + await db.collection('example').insert({ nothing: 'here' }) + + const results1 = await db.collection('example').find({ + example: { $exists: true } + }) + + t.equal(results1.length, 1, 'Found document with field') + + const results2 = await db.collection('example').find({ + example: { $exists: false } + }) + + t.equal(results2.length, 1, 'Found document without field') + + t.end() + } finally { + await db.close() + } +}) + +test('Create indexes and list them', async (t) => { + const db = new DB(getBee()) + try { + await db + .collection('example') + .insert({ example: 1, createdAt: new Date() }) + + await db.collection('example').createIndex(['createdAt', 'example']) + + const indexes = await db.collection('example').listIndexes() + + t.equal(indexes.length, 1, 'Got one index') + t.deepEqual( + indexes[0].fields, + ['createdAt', 'example'], + 'Index containes expected fields' + ) + t.equal( + indexes[0].name, + ['createdAt', 'example'].join(','), + 'Index generated expected name' + ) + + await db + .collection('example') + .insert({ example: 2, createdAt: new Date() }) + + t.ok('Able to insert document with index') + + t.end() + } finally { + await db.close() + } +}) + +test('Sort by index', async (t) => { + const db = new DB(getBee()) + try { + await db.collection('example').createIndex(['createdAt']) + + await db + .collection('example') + .insert({ example: 1, createdAt: new Date(1000) }) + await db + .collection('example') + .insert({ example: 2, createdAt: new Date(2000) }) + await db + .collection('example') + .insert({ example: 3, createdAt: new Date(3000) }) + + let counter = 3 + for await (const { example, createdAt } of db + .collection('example') + .find() + .sort('createdAt', -1)) { + t.equal(example, counter, 'Got doc in expected order') + t.equal(createdAt.getTime(), counter * 1000, 'Got expected timestamp') + counter-- + } + + t.equal(counter, 0, 'Sorted through all 3 documents') + + t.end() + } finally { + await db.close() + } +}) + +test('Cannot sort without index', async (t) => { + const db = new DB(getBee()) + try { + try { + await db.collection('example').find().sort('notfound') + } catch { + t.pass('Threw error when sorting without index') + } + + t.end() + } finally { + await db.close() + } +}) + +test('Limit and skip with index sort', async (t) => { + const db = new DB(getBee()) + const NUM_TO_MAKE = 30 + let i = NUM_TO_MAKE + try { + await db.collection('example').createIndex(['i']) + + while (i--) { + await db.collection('example').insert({ i }) + } + + const query = db + .collection('example') + .find() + .skip(10) + .limit(10) + .sort('i', -1) + + const index = await query.getIndex() + + t.ok(index, 'Using index for search') + + const found = await query + + t.equal(found.length, 10, 'Got expected number of items') + + const onlyIs = found.map(({ i }) => i) + + const expected = [19, 18, 17, 16, 15, 14, 13, 12, 11, 10] + + t.deepEqual(onlyIs, expected, 'Got expected subset of Ids') + + t.end() + } finally { + await db.close() + } +}) + +test('Use $eq for indexes', async (t) => { + const db = new DB(getBee()) + try { + const indexFields = ['color', 'flavor'] + await db.collection('example').createIndex(indexFields) + + await db + .collection('example') + .insert({ example: 1, color: 'red', flavor: 'watermelon' }) + await db + .collection('example') + .insert({ example: 2, color: 'red', flavor: 'raspberry' }) + await db + .collection('example') + .insert({ example: 3, color: 'purple', flavor: 'good' }) + + const query = db.collection('example').find({ + color: 'red' + }) + + const index = await query.getIndex() + + t.ok(index, 'Using an index for the query') + t.deepEqual(index?.index?.fields, indexFields, 'Using the correct index') + + const results = await query + + t.equal(results.length, 2, 'Got expected documents') + + const sortedQuery = query.sort('flavor', -1) + + const sortedIndex = await sortedQuery.getIndex() + + t.ok(sortedIndex, 'Using an index for the sorted query') + + const sorted = await sortedQuery + + t.equal(sorted.length, 2, 'Got expected documents when sorting') + t.equal(sorted[0]?.flavor, 'watermelon', 'Got expected order for sort') + + t.end() + } finally { + await db.close() + } +}) + +test('Arrays get flattened for indexes', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['ingredients', 'name']) + + await db.collection('example').insert({ + name: 'le ghetti du spa', + ingredients: ['noodles', 'corn', 'sauce'] + }) + await db.collection('example').insert({ + name: 'cheeseland', + ingredients: ['corn', 'cheese', 'sauce'] + }) + await db.collection('example').insert({ + name: 'literally corn', + ingredients: ['corn'] + }) + + const query = db + .collection('example') + .find({ + ingredients: 'sauce' + }) + .sort('name') + + const index = await query.getIndex() + + t.ok(index, 'Using an index for the query') + t.deepEqual( + index?.index?.fields, + ['ingredients', 'name'], + 'Using the correct index' + ) + + const results = await query + + t.equal(results.length, 2, 'Found two matching documents') + t.equal(results[0]?.name, 'cheeseland', 'Documents got sorted correctly') + + t.end() + } finally { + await db.close() + } +}) + +test('Indexed Search using $exists', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['example']) + + await db.collection('example').insert({ example: 'wow' }) + await db.collection('example').insert({ nothing: 'here' }) + + const hasIndex = await db + .collection('example') + .find({ + example: { $exists: true } + }) + .getIndex() + + t.ok(hasIndex, 'Using index for search') + + const results1 = await db.collection('example').find({ + example: { $exists: true } + }) + + t.equal(results1.length, 1, 'Found document with field') + + const results2 = await db.collection('example').find({ + example: { $exists: false } + }) + + t.equal(results2.length, 1, 'Found document without field') + + t.end() + } finally { + await db.close() + } +}) + +test('Indexed Search by date fields (with sort)', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['example']) + await db.collection('example').insert({ example: new Date(2000, 0) }) + await db.collection('example').insert({ example: new Date(2000, 2) }) + await db.collection('example').insert({ example: new Date(2000, 6) }) + await db.collection('example').insert({ example: new Date(2000, 11) }) + + const query = db + .collection('example') + .find({ + example: { + $gte: new Date(2000, 1), + $lte: new Date(2000, 6) + } + }) + .sort('example') + + const index = await query.getIndex() + + t.ok(index, 'Using index for date search') + + const found1 = await query + + t.equal(found1.length, 2, 'Found 2 documents >= Feb and <= July') + + t.end() + } finally { + await db.close() + } +}) + +test('Indexed Search using $in and $all with numbers', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['example']) + + // Account for array fields that aren't in the index. + await db + .collection('example') + .insert({ example: [1, 3, 5, 7, 9], fake: [] }) + await db + .collection('example') + .insert({ example: [2, 3, 6, 8, 10], fake: [] }) + await db.collection('example').insert({ example: 1, fake: [] }) + await db.collection('example').insert({ example: 2, fake: [] }) + + const query1 = db.collection('example').find({ + example: { + $in: [1, 3, 8] + } + }) + + const index1 = await query1.getIndex() + + t.ok(index1, 'Using index for $in search') + + const found1 = await query1 + + t.equal(found1.length, 3, 'Found 3 matching documents') + + const query2 = db.collection('example').find({ + example: { + $all: [2, 6, 8] + } + }) + + const index2 = await query2.getIndex() + + t.ok(index2, 'Using index for $all search') + + const found2 = await query2 + + t.equal(found2.length, 1, 'Found 1 matching document') + + t.end() + } finally { + await db.close() + } +}) + +test('Indexed Search using $in and $all with string', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['example']) + + await db + .collection('example') + .insert({ example: ['cats', 'frogs', 'pets', 'spiders', 'furry'] }) + await db + .collection('example') + .insert({ example: ['dogs', 'frogs', 'companions', 'bats'] }) + await db.collection('example').insert({ example: 'cats' }) + await db.collection('example').insert({ example: 'dogs' }) + + const query1 = db.collection('example').find({ + example: { + $in: ['cats', 'frogs', 'bats'] + } + }) + + const index1 = await query1.getIndex() + + t.ok(index1, 'Using index for $in search') + + const found1 = await query1 + + t.equal(found1.length, 3, 'Found 3 matching documents') + + const query2 = db.collection('example').find({ + example: { + $all: ['dogs', 'companions', 'bats'] + } + }) + + const index2 = await query2.getIndex() + + t.ok(index2, 'Using index for $all search') + + const found2 = await query2 + + t.equal(found2.length, 1, 'Found 1 matching document') + + t.end() + } finally { + await db.close() + } +}) + +test('Indexed text search using sort and $all', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['index', 'example']) + + await db + .collection('example') + .insert({ index: 1, example: ['hello', 'world'] }) + await db + .collection('example') + .insert({ index: 2, example: ['goodbye', 'world'] }) + + const results1 = await db.collection('example').find({ + example: { + $all: ['world'] + } + }) + + t.equal(results1.length, 2, 'Matched two documents for $all') + t.end() + } finally { + await db.close() + } +}) + +test('Use hint API to specify the index to use', async (t) => { + const db = new DB(getBee()) + + try { + await db.collection('example').createIndex(['example']) + await db.collection('example').createIndex(['createdAt']) + + await db + .collection('example') + .insert({ example: 'wow', createdAt: new Date() }) + await db + .collection('example') + .insert({ example: 'here', createdAt: new Date() }) + + const chosen1 = await db + .collection('example') + .find({}) + .hint('example') + .getIndex() + + t.equal(chosen1?.index?.name, 'example', 'Hinted index got used') + + const chosen2 = await db + .collection('example') + .find({}) + .sort('createdAt') + .hint('createdAt') + .getIndex() + + t.equal(chosen2?.index?.name, 'createdAt', 'Hinted index got used') + + t.end() + } finally { + await db.close() + } +}) + +test('Inserting over a document is an error', async (t) => { + const db = new DB(getBee()) + + try { + const doc = await db.collection('example').insert({ _hello: 'world' }) + + try { + await db.collection('example').insert(doc) + t.fail('Did not throw an error') + } catch (e) { + t.pass('Inserting threw an error') + } + } finally { + await db.close() + } +}) + +test('Upsert a document', async (t) => { + const db = new DB(getBee()) + + try { + const { nUpserted, nModified, nMatched } = await db + .collection('example') + .update( + {}, + { + hello: 'world' + }, + { upsert: true } + ) + + t.equal(nUpserted, 1, 'Upserted a doc') + t.equal(nMatched, 0, 'No existing docs matched') + t.equal(nModified, 0, 'No existing docs modified') + + const doc = await db.collection('example').findOne({ hello: 'world' }) + + t.ok(doc, 'Found doc') + t.equal(doc?.hello, 'world', 'Field got set') + } finally { + await db.close() + } +}) + +test('.update with $set, $unset, $rename', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + const doc = await collection.insert({ + foo: 'bar', + goodbye: 'world', + something: 'something' + }) + + const { nUpserted, nModified, nMatched } = await collection.update( + {}, + { + $set: { + foo: 'bazz', + fizz: 'buzz' + }, + // Set with raw fields + hello: 'world', + $unset: { + goodbye: '' + }, + $rename: { + something: 'whatever' + } + } + ) + + t.equal(nUpserted, 0, 'No upserts') + t.equal(nMatched, 1, 'One match') + t.equal(nModified, 1, 'One change') + + const updatedDoc = await collection.findOne({ _id: doc._id }) + + t.ok(updatedDoc, 'Found after updating') + + t.equal(updatedDoc.foo, 'bazz', 'Existing field got updated') + t.equal(updatedDoc.fizz, 'buzz', 'New field got set') + t.equal(updatedDoc.hello, 'world', 'Raw field got set') + t.notOk('goodbye' in updatedDoc, 'Field got unset') + t.notOk('something' in updatedDoc, 'Renamed field got removed') + t.equal(updatedDoc.whatever, 'something', 'Field got renamed') + } finally { + await db.close() + } +}) + +test('.update with $inc, $mult', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + const doc = await collection.insert({ + incValue: 4, + multValue: 4 + }) + + const { nUpserted, nModified, nMatched } = await collection.update( + {}, + { + $inc: { + incValue: 20, + incSet: 666 + }, + $mul: { + multValue: 20, + multSet: 666 + } + } + ) + + t.equal(nUpserted, 0, 'No upserts') + t.equal(nMatched, 1, 'One match') + t.equal(nModified, 1, 'One change') + + const updatedDoc = await collection.findOne({ _id: doc._id }) + + t.ok(updatedDoc, 'Found after updating') + t.equal(updatedDoc?.incValue, 4 + 20, 'Value got incremented') + t.equal(updatedDoc?.incSet, 666, 'Unset field got set') + + t.equal(updatedDoc?.multValue, 4 * 20, 'Value got multiplied') + t.equal(updatedDoc?.multSet, 0, 'Unset field got set to 0') + } finally { + await db.close() + } +}) + +test('.update with $push, $addToSet', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + const doc = await collection.insert({ + existingSet: ['a', 'b'], + duplicateSet: ['a', 'b'], + eachSet: ['a', 'b'], + existingPush: ['a', 'b'], + duplicatePush: ['a', 'b'], + eachPush: ['a', 'b'] + }) + + const { nUpserted, nModified, nMatched } = await collection.update( + {}, + { + $addToSet: { + existingSet: 'c', + duplicateSet: 'a', + eachSet: { $each: ['b', 'c'] } + }, + $push: { + existingPush: 'c', + duplicatePush: 'a', + eachPush: { $each: ['b', 'c'] } + } + } + ) + + t.equal(nUpserted, 0, 'No upserts') + t.equal(nMatched, 1, 'One match') + t.equal(nModified, 1, 'One change') + + const updatedDoc = await collection.findOne({ _id: doc._id }) + + t.ok(updatedDoc, 'Found after updating') + + t.deepEqual(updatedDoc.existingSet, ['a', 'b', 'c']) + t.deepEqual(updatedDoc.duplicateSet, ['a', 'b']) + t.deepEqual(updatedDoc.eachSet, ['a', 'b', 'c']) + + t.deepEqual(updatedDoc.existingPush, ['a', 'b', 'c']) + t.deepEqual(updatedDoc.duplicatePush, ['a', 'b', 'a']) + t.deepEqual(updatedDoc.eachPush, ['a', 'b', 'b', 'c']) + } finally { + await db.close() + } +}) + +test('.update multiple documents', async (t) => { + const db = new DB(getBee()) + + t.plan(4 + 3) + + try { + const collection = db.collection('example') + + await collection.insert({ value: 0 }) + await collection.insert({ value: 0 }) + await collection.insert({ value: 0 }) + await collection.insert({ value: 0 }) + + const { nUpserted, nModified, nMatched } = await collection.update( + {}, + { + $inc: { + value: 1 + } + }, + { multi: true } + ) + + t.equal(nUpserted, 0, 'No upserts') + t.equal(nMatched, 4, '4 matches') + t.equal(nModified, 4, '4 changes') + + for await (const doc of collection.find()) { + t.equal(doc.value, 1, 'Doc got updated') + } + } finally { + await db.close() + } +}) + +test('.update with array of updates', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + await collection.insert({ value: 0 }) + + const { nUpserted, nModified, nMatched } = await collection.update({}, [ + { $inc: { value: 1 } }, + { $rename: { value: 'something' } } + ]) + + t.equal(nUpserted, 0, 'No upserts') + t.equal(nMatched, 1, 'One match') + t.equal(nModified, 1, 'One change') + + const doc = await collection.findOne() + + t.equal(doc?.something, 1, 'field got incremented and renamed') + } finally { + await db.close() + } +}) + +/* Test template + +test('', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + } finally { + await db.close() + } +}) +*/ From 105b3aae3b268096e4172e873b4ac9f5d50407fb Mon Sep 17 00:00:00 2001 From: Jampard Date: Fri, 2 Sep 2022 19:10:10 +0200 Subject: [PATCH 2/6] Support query type $ne --- index.js | 5 +++++ test_autobee.js | 15 ++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index e11fb2d..b634ddb 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,7 @@ const QUERY_TYPES = { $all: compareAll, // Equality + $ne: compareNe, $eq: compareEq, $exists: compareExists } @@ -603,6 +604,10 @@ function compareLte (docValue, queryValue) { return ensureComparable(docValue) <= ensureComparable(queryValue) } +function compareNe (docValue, queryValue) { + return ensureComparable(docValue) !== ensureComparable(queryValue) +} + function ensureComparable (value) { if (value instanceof Date) return value.getTime() return value diff --git a/test_autobee.js b/test_autobee.js index 7240e17..45de4e6 100644 --- a/test_autobee.js +++ b/test_autobee.js @@ -142,9 +142,6 @@ test('Iterate through different collections of different base', async (t) => { const db2 = new DB(base2) try { - // await db.collection('example').insert({ example: 'Hello' }) - // await db.collection('example').insert({ example: 'World' }) - const doc1 = await db.collection('patras').insert({ example: 'Hello' }) const doc2 = await db.collection('patras').insert({ example: 'World' }) @@ -248,13 +245,13 @@ test('Search by number fields', async (t) => { t.equal(found3.length, 1, 'Found 1 document < 10') - // const found4 = await db.collection('example').find({ - // example: { - // $ne: 666 - // } - // }) + const found4 = await db.collection('example').find({ + example: { + $ne: 666 + } + }) - // t.equal(found4.length, 3, 'Found 3 document =! 666') + t.equal(found4.length, 3, 'Found 3 document =! 666') t.end() } finally { From f8d764ad7a9f49abe06aa7129b671f834ad0f0c3 Mon Sep 17 00:00:00 2001 From: Jampard Date: Fri, 2 Sep 2022 19:14:53 +0200 Subject: [PATCH 3/6] refactor: Renamed Simpleautobee to Autodeebee --- README.md | 4 ++-- autobee.js => autodeebee.js | 4 ++-- test_autobee.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename autobee.js => autodeebee.js (95%) diff --git a/README.md b/README.md index 4496c92..02df363 100644 --- a/README.md +++ b/README.md @@ -72,14 +72,14 @@ const eggbert = await db.collection('example').findOne({name: 'Eggbert'}) localOutput: firstOutput, localInput: firstUser }) - const autobee = new SimpleAutobee(base) + const autobee = new Autodeebee(base) // Create a new DB const db = new DB(autobee) // You can then use the DB the same way as you did above. ``` -You also need to use the [Autobee class](./autobee.js): +You also need to use the [Autodeebee class](./autodeebee.js): This class redefines the functions of Hyperbee to be compatible with the DB. ## Data Types diff --git a/autobee.js b/autodeebee.js similarity index 95% rename from autobee.js rename to autodeebee.js index 18e1ca9..e77fcf1 100644 --- a/autobee.js +++ b/autodeebee.js @@ -1,7 +1,7 @@ const Hyperbee = require('hyperbee') const b4a = require('b4a') -module.exports = class SimpleAutobee { +module.exports = class Autodeebee { constructor (autobase, opts) { this.autobase = autobase this.opts = opts @@ -34,7 +34,7 @@ module.exports = class SimpleAutobee { sub (name) { const opts = this.opts ?? {} opts.sub = true - const auto = new SimpleAutobee(this.autobase, opts) + const auto = new Autodeebee(this.autobase, opts) auto.bee = this.bee.sub(name) return auto } diff --git a/test_autobee.js b/test_autobee.js index 45de4e6..b9a1aa7 100644 --- a/test_autobee.js +++ b/test_autobee.js @@ -3,7 +3,7 @@ const RAM = require('random-access-memory') const Hypercore = require('hypercore') const Autobase = require('autobase') const HyperbeeDeeBee = require('./') -const SimpleAutobee = require('./autobee') +const Autodeebee = require('./autodeebee') const { DB } = HyperbeeDeeBee function getBee () { @@ -16,7 +16,7 @@ function getBee () { localOutput: firstOutput, localInput: firstUser }) - return new SimpleAutobee(base1) + return new Autodeebee(base1) } // eslint-disable-next-line no-unused-vars function getBees () { @@ -38,7 +38,7 @@ function getBees () { localInput: secondUser }) - return [new SimpleAutobee(base1), new SimpleAutobee(base2)] + return [new Autodeebee(base1), new Autodeebee(base2)] } test('Create a document in a collection', async (t) => { From 131a6955bd41076bdeac393e924310b44c871276 Mon Sep 17 00:00:00 2001 From: Jampard Date: Sun, 4 Sep 2022 23:33:04 +0200 Subject: [PATCH 4/6] feat: delete doc --- .gitignore | 1 + index.js | 133 ++++++++++++++++++++++++++++++++++-------------- test.js | 28 ++++++++++ test_autobee.js | 29 +++++++++++ 4 files changed, 152 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index 6704566..493a824 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ typings/ # Yarn Integrity file .yarn-integrity +yarn.lock # dotenv environment variables file .env diff --git a/index.js b/index.js index b634ddb..93734bf 100644 --- a/index.js +++ b/index.js @@ -107,11 +107,7 @@ class Collection { } async update (query = {}, update = {}, options = {}) { - const { - upsert = false, - multi = false, - hint = null - } = options + const { upsert = false, multi = false, hint = null } = options let nMatched = 0 let nUpserted = 0 @@ -148,7 +144,9 @@ class Collection { for (const queryField of Object.keys(query)) { const queryValue = query[queryField] if ('$eq' in queryValue) initialDoc[queryField] = queryValue.$eq - else if (!isQueryObject(queryValue)) initialDoc[queryField] = queryValue + else if (!isQueryObject(queryValue)) { + initialDoc[queryField] = queryValue + } } const newDoc = performUpdate(initialDoc, update) @@ -164,8 +162,39 @@ class Collection { } } + async delete (query = {}, options = {}) { + const { multi = false, hint = null } = options + + let nDeleted = 0 + + let cursor = this.find(query) + if (hint) cursor = cursor.hint(hint) + if (!multi) cursor = cursor.limit(1) + + const indexes = await this.listIndexes() + + for await (const doc of cursor) { + nDeleted++ + + const key = doc._id.id + + await this.docs.del(key) + + for (const { fields, name } of indexes) { + // TODO: Cache index subs + const bee = this.idx.sub(name) + + await this._deIndexDocument(bee, fields, doc) + } + } + + return { + nDeleted + } + } + async findOne (query = {}) { - const results = await (this.find(query).limit(1)) + const results = await this.find(query).limit(1) const [doc] = results @@ -178,7 +207,10 @@ class Collection { return new Cursor(query, this) } - async createIndex (fields, { rebuild = false, version = INDEX_VERSION, ...opts } = {}) { + async createIndex ( + fields, + { rebuild = false, version = INDEX_VERSION, ...opts } = {} + ) { const name = fields.join(',') const exists = await this.indexExists(name) // Don't rebuild index if it's already set @@ -269,12 +301,16 @@ class Collection { } class Cursor { - constructor (query = {}, collection, opts = { - limit: Infinity, - skip: 0, - sort: null, - hint: null - }) { + constructor ( + query = {}, + collection, + opts = { + limit: Infinity, + skip: 0, + sort: null, + hint: null + } + ) { this.query = query this.collection = collection // TODO: Validate opts @@ -320,12 +356,14 @@ class Cursor { const queryFields = Object.keys(query) // Filter out fields with `$exists: false` since we can't index non-existance const existingFields = queryFields.filter((field) => { - return isQueryObject(query[field]) ? query[field].$exists !== false : true + return isQueryObject(query[field]) + ? query[field].$exists !== false + : true }) const eqS = existingFields.filter((name) => { const queryValue = query[name] if (!isQueryObject(queryValue)) return true - return ('$eq' in queryValue) + return '$eq' in queryValue }) if (hint) { @@ -333,9 +371,13 @@ class Cursor { const { fields } = hintIndex if (sort) { const sortIndex = fields.indexOf(sort.field) - if (sortIndex === -1) throw new Error("Hinted Index doesn't match required sort") + if (sortIndex === -1) { + throw new Error("Hinted Index doesn't match required sort") + } const consecutive = consecutiveSubset(fields, eqS) - if (consecutive !== sortIndex) throw new Error("Hinted index doesn't match required sort") + if (consecutive !== sortIndex) { + throw new Error("Hinted index doesn't match required sort") + } } const prefixFields = fields.slice(0, consecutiveSubset(fields, eqS)) @@ -368,7 +410,9 @@ class Cursor { }) // Sort by most $eq fields at the beginning .sort(({ fields: fieldsA }, { fields: fieldsB }) => { - return consecutiveSubset(fieldsB, eqS) - consecutiveSubset(fieldsA, eqS) + return ( + consecutiveSubset(fieldsB, eqS) - consecutiveSubset(fieldsA, eqS) + ) }) // The best is the one with the most eqS @@ -402,7 +446,7 @@ class Cursor { } async * [Symbol.asyncIterator] () { - if (this.query._id && (this.query._id instanceof ObjectID)) { + if (this.query._id && this.query._id instanceof ObjectID) { // Doc IDs are unique, so we can query against them without doing a search const key = this.query._id.id @@ -423,11 +467,7 @@ class Cursor { } yield doc } else { - const { - limit = Infinity, - skip = 0, - sort - } = this.opts + const { limit = Infinity, skip = 0, sort } = this.opts const query = this.query const seen = new Set() @@ -480,10 +520,15 @@ class Cursor { return isQueryObject(query[field]) ? !('$all' in query[field]) : true }) const subQuery = getSubset(query, subQueryFields) - const gt = makeIndexKeyFromQuery(query, prefixFields, index.fields, makeIndexKey) + const gt = makeIndexKeyFromQuery( + query, + prefixFields, + index.fields, + makeIndexKey + ) const opts = { - reverse: (sort?.direction === -1) + reverse: sort?.direction === -1 } if (gt && gt.length) { opts.gt = gt @@ -493,10 +538,12 @@ class Cursor { gt.copy(lt) // Set to MAX byte to only use keys with this prefix - lt[lt.length - 1] = 0xFF + lt[lt.length - 1] = 0xff } - const stream = this.collection.idx.sub(index.name).createReadStream(opts) + const stream = this.collection.idx + .sub(index.name) + .createReadStream(opts) for await (const { key, value: rawId } of stream) { const keyDoc = makeDocFromIndex(key, index.fields) @@ -570,9 +617,13 @@ function queryCompare (docValue, queryValue) { function compareAll (docValue, queryValue) { // TODO: Add query validator function to detect this early. - if (!Array.isArray(queryValue)) throw new Error('$all must be set to an array') + if (!Array.isArray(queryValue)) { + throw new Error('$all must be set to an array') + } if (Array.isArray(docValue)) { - return queryValue.every((fromQuery) => docValue.some((fromDoc) => compareEq(fromDoc, fromQuery))) + return queryValue.every((fromQuery) => + docValue.some((fromDoc) => compareEq(fromDoc, fromQuery)) + ) } else { return false } @@ -580,9 +631,13 @@ function compareAll (docValue, queryValue) { function compareIn (docValue, queryValue) { // TODO: Add query validator function to detect this early. - if (!Array.isArray(queryValue)) throw new Error('$in must be set to an array') + if (!Array.isArray(queryValue)) { + throw new Error('$in must be set to an array') + } if (Array.isArray(docValue)) { - return docValue.some((fromDoc) => queryValue.some((fromQuery) => compareEq(fromDoc, fromQuery))) + return docValue.some((fromDoc) => + queryValue.some((fromQuery) => compareEq(fromDoc, fromQuery)) + ) } else { return queryValue.some((fromQuery) => compareEq(docValue, fromQuery)) } @@ -615,8 +670,7 @@ function ensureComparable (value) { function compareEq (docValue, queryValue) { if (Array.isArray(docValue)) { - return docValue - .some((item) => compareEq(item, queryValue)) + return docValue.some((item) => compareEq(item, queryValue)) } else if (typeof docValue?.equals === 'function') { return docValue.equals(queryValue) } else { @@ -736,7 +790,7 @@ function updateMul (doc, fields) { } function hasFields (doc, fields) { - return fields.every((field) => (field in doc) && (field !== undefined)) + return fields.every((field) => field in doc && field !== undefined) } function makeIndexKeyV1 (doc, fields) { @@ -745,7 +799,8 @@ function makeIndexKeyV1 (doc, fields) { // Serialize the data into a BSON array const buffer = BSON.serialize( // Take all the indexed fields - fields.map((field) => doc[field]) + fields + .map((field) => doc[field]) // Add the document ID .concat(doc._id || []) ) @@ -791,7 +846,7 @@ function makeIndexKeyV2 (doc, fields, allFields = fields) { // If the number of fields in the index is greater than what we're generating // We should pad the list with some null bytes // Then we should remove these bytes to get the real prefix - while (keyValues.length < (allFields.length + 1)) { + while (keyValues.length < allFields.length + 1) { keyValues.push(0) toRemove++ } @@ -880,7 +935,7 @@ function makeIndexKeyFromQuery (query, fields, indexFields, makeIndexKey) { } function isQueryObject (object) { - return (typeof object === 'object') && has$Keys(object) + return typeof object === 'object' && has$Keys(object) } function has$Keys (object) { diff --git a/test.js b/test.js index 56ae983..9f8be94 100644 --- a/test.js +++ b/test.js @@ -650,6 +650,34 @@ test('Inserting over a document is an error', async (t) => { } }) +test('.delete a document', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + const doc = await collection.insert({ + foo: 'bar', + goodbye: 'world', + something: 'something' + }) + + const { + nDeleted + } = await collection.delete({ foo: 'bar' }) + + t.equal(nDeleted, 1, 'One match') + + try { + await collection.findOne({ _id: doc._id }) + t.fail('Did not throw an error') + } catch (e) { + t.pass('Retrieving deleted doc threw an error') + } + } finally { + await db.close() + } +}) test('Upsert a document', async (t) => { const db = new DB(getBee()) diff --git a/test_autobee.js b/test_autobee.js index b9a1aa7..0c3eef9 100644 --- a/test_autobee.js +++ b/test_autobee.js @@ -801,6 +801,35 @@ test('Inserting over a document is an error', async (t) => { } }) +test('.delete a document', async (t) => { + const db = new DB(getBee()) + + try { + const collection = db.collection('example') + + const doc = await collection.insert({ + foo: 'bar', + goodbye: 'world', + something: 'something' + }) + + const { + nDeleted + } = await collection.delete({ foo: 'bar' }) + + t.equal(nDeleted, 1, 'One match') + + try { + await collection.findOne({ _id: doc._id }) + t.fail('Did not throw an error') + } catch (e) { + t.pass('Retrieving deleted doc threw an error') + } + } finally { + await db.close() + } +}) + test('Upsert a document', async (t) => { const db = new DB(getBee()) From 0102807fecaa056b17e41c2bbc63e02d86435022 Mon Sep 17 00:00:00 2001 From: Jamps Date: Thu, 3 Nov 2022 16:47:04 +0100 Subject: [PATCH 5/6] feat: add types --- index.d.ts | 4441 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 7 +- 2 files changed, 4445 insertions(+), 3 deletions(-) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..1ef1729 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,4441 @@ +/** Declaration file generated by dts-gen */ + +export class Collection { + constructor(...args: any[]); + + createIndex(...args: any[]): void; + + find(...args: any[]): void; + + findOne(...args: any[]): void; + + getIndex(...args: any[]): void; + + indexExists(...args: any[]): void; + + insert(...args: any[]): void; + + listIndexes(...args: any[]): void; + + reIndex(...args: any[]): void; + + update(...args: any[]): void; + +} + +export class Cursor { + constructor(...args: any[]); + + count(...args: any[]): void; + + getIndex(...args: any[]): void; + + hint(...args: any[]): void; + + limit(...args: any[]): void; + + skip(...args: any[]): void; + + sort(...args: any[]): void; + + then(...args: any[]): void; + +} + +export class DB { + constructor(...args: any[]); + + close(...args: any[]): void; + + collection(...args: any[]): void; + +} + +export namespace BSON { + class BSONError { + constructor(message: any); + + static captureStackTrace(p0: any, p1: any): any; + + static stackTraceLimit: number; + + } + + class BSONRegExp { + constructor(pattern: any, options: any); + + toExtendedJSON(options: any): any; + + static fromExtendedJSON(doc: any): any; + + static parseOptions(options: any): any; + + } + + class BSONSymbol { + constructor(value: any); + + inspect(): any; + + toExtendedJSON(): any; + + toJSON(): any; + + toString(): any; + + valueOf(): any; + + static fromExtendedJSON(doc: any): any; + + } + + class BSONTypeError { + constructor(message: any); + + static captureStackTrace(p0: any, p1: any): any; + + static stackTraceLimit: number; + + } + + class Binary { + constructor(buffer: any, subType: any); + + inspect(): any; + + length(): any; + + put(byteValue: any): void; + + read(position: any, length: any): any; + + toExtendedJSON(options: any): any; + + toJSON(): any; + + toString(format: any): any; + + toUUID(): any; + + value(asRaw: any): any; + + write(sequence: any, offset: any): void; + + static BSON_BINARY_SUBTYPE_DEFAULT: number; + + static BUFFER_SIZE: number; + + static SUBTYPE_BYTE_ARRAY: number; + + static SUBTYPE_COLUMN: number; + + static SUBTYPE_DEFAULT: number; + + static SUBTYPE_ENCRYPTED: number; + + static SUBTYPE_FUNCTION: number; + + static SUBTYPE_MD5: number; + + static SUBTYPE_USER_DEFINED: number; + + static SUBTYPE_UUID: number; + + static SUBTYPE_UUID_OLD: number; + + static fromExtendedJSON(doc: any, options: any): any; + + } + + class Code { + constructor(code: any, scope: any); + + inspect(): any; + + toExtendedJSON(): any; + + toJSON(): any; + + static fromExtendedJSON(doc: any): any; + + } + + class DBRef { + constructor(collection: any, oid: any, db: any, fields: any); + + inspect(): any; + + toExtendedJSON(options: any): any; + + toJSON(): any; + + static fromExtendedJSON(doc: any): any; + + } + + class Decimal128 { + constructor(bytes: any); + + inspect(): any; + + toExtendedJSON(): any; + + toJSON(): any; + + toString(): any; + + static fromExtendedJSON(doc: any): any; + + static fromString(representation: any): any; + + } + + class Double { + constructor(value: any); + + inspect(): any; + + toExtendedJSON(options: any): any; + + toJSON(): any; + + toString(radix: any): any; + + valueOf(): any; + + static fromExtendedJSON(doc: any, options: any): any; + + } + + class Int32 { + constructor(value: any); + + inspect(): any; + + toExtendedJSON(options: any): any; + + toJSON(): any; + + toString(radix: any): any; + + valueOf(): any; + + static fromExtendedJSON(doc: any, options: any): any; + + } + + class Long { + constructor(low: any, high: any, unsigned: any); + + add(addend: any): any; + + and(other: any): any; + + comp(other: any): any; + + compare(other: any): any; + + div(divisor: any): any; + + divide(divisor: any): any; + + eq(other: any): any; + + equals(other: any): any; + + eqz(): any; + + ge(other: any): any; + + getHighBits(): any; + + getHighBitsUnsigned(): any; + + getLowBits(): any; + + getLowBitsUnsigned(): any; + + getNumBitsAbs(): any; + + greaterThan(other: any): any; + + greaterThanOrEqual(other: any): any; + + gt(other: any): any; + + gte(other: any): any; + + inspect(): any; + + isEven(): any; + + isNegative(): any; + + isOdd(): any; + + isPositive(): any; + + isZero(): any; + + le(other: any): any; + + lessThan(other: any): any; + + lessThanOrEqual(other: any): any; + + lt(other: any): any; + + lte(other: any): any; + + mod(divisor: any): any; + + modulo(divisor: any): any; + + mul(multiplier: any): any; + + multiply(multiplier: any): any; + + ne(other: any): any; + + neg(): any; + + negate(): any; + + neq(other: any): any; + + not(): any; + + notEquals(other: any): any; + + or(other: any): any; + + rem(divisor: any): any; + + shiftLeft(numBits: any): any; + + shiftRight(numBits: any): any; + + shiftRightUnsigned(numBits: any): any; + + shl(numBits: any): any; + + shr(numBits: any): any; + + shr_u(numBits: any): any; + + shru(numBits: any): any; + + sub(subtrahend: any): any; + + subtract(subtrahend: any): any; + + toBigInt(): any; + + toBytes(le: any): any; + + toBytesBE(): any; + + toBytesLE(): any; + + toExtendedJSON(options: any): any; + + toInt(): any; + + toNumber(): any; + + toSigned(): any; + + toString(radix: any): any; + + toUnsigned(): any; + + xor(other: any): any; + + static fromBigInt(value: any, unsigned: any): any; + + static fromBits(lowBits: any, highBits: any, unsigned: any): any; + + static fromBytes(bytes: any, unsigned: any, le: any): any; + + static fromBytesBE(bytes: any, unsigned: any): any; + + static fromBytesLE(bytes: any, unsigned: any): any; + + static fromExtendedJSON(doc: any, options: any): any; + + static fromInt(value: any, unsigned: any): any; + + static fromNumber(value: any, unsigned: any): any; + + static fromString(str: any, unsigned: any, radix: any): any; + + static fromValue(val: any, unsigned: any): any; + + static isLong(value: any): any; + + } + + class LongWithoutOverridesClass { + constructor(low: any, high: any, unsigned: any); + + add(addend: any): any; + + and(other: any): any; + + comp(other: any): any; + + compare(other: any): any; + + div(divisor: any): any; + + divide(divisor: any): any; + + eq(other: any): any; + + equals(other: any): any; + + eqz(): any; + + ge(other: any): any; + + getHighBits(): any; + + getHighBitsUnsigned(): any; + + getLowBits(): any; + + getLowBitsUnsigned(): any; + + getNumBitsAbs(): any; + + greaterThan(other: any): any; + + greaterThanOrEqual(other: any): any; + + gt(other: any): any; + + gte(other: any): any; + + inspect(): any; + + isEven(): any; + + isNegative(): any; + + isOdd(): any; + + isPositive(): any; + + isZero(): any; + + le(other: any): any; + + lessThan(other: any): any; + + lessThanOrEqual(other: any): any; + + lt(other: any): any; + + lte(other: any): any; + + mod(divisor: any): any; + + modulo(divisor: any): any; + + mul(multiplier: any): any; + + multiply(multiplier: any): any; + + ne(other: any): any; + + neg(): any; + + negate(): any; + + neq(other: any): any; + + not(): any; + + notEquals(other: any): any; + + or(other: any): any; + + rem(divisor: any): any; + + shiftLeft(numBits: any): any; + + shiftRight(numBits: any): any; + + shiftRightUnsigned(numBits: any): any; + + shl(numBits: any): any; + + shr(numBits: any): any; + + shr_u(numBits: any): any; + + shru(numBits: any): any; + + sub(subtrahend: any): any; + + subtract(subtrahend: any): any; + + toBigInt(): any; + + toBytes(le: any): any; + + toBytesBE(): any; + + toBytesLE(): any; + + toExtendedJSON(options: any): any; + + toInt(): any; + + toNumber(): any; + + toSigned(): any; + + toString(radix: any): any; + + toUnsigned(): any; + + xor(other: any): any; + + static fromBigInt(value: any, unsigned: any): any; + + static fromBits(lowBits: any, highBits: any, unsigned: any): any; + + static fromBytes(bytes: any, unsigned: any, le: any): any; + + static fromBytesBE(bytes: any, unsigned: any): any; + + static fromBytesLE(bytes: any, unsigned: any): any; + + static fromExtendedJSON(doc: any, options: any): any; + + static fromInt(value: any, unsigned: any): any; + + static fromNumber(value: any, unsigned: any): any; + + static fromString(str: any, unsigned: any, radix: any): any; + + static fromValue(val: any, unsigned: any): any; + + static isLong(value: any): any; + + } + + class Map { + constructor(); + + // Native method; no parameter or return type inference available + clear(): any; + + // Native method; no parameter or return type inference available + delete(p0: any): any; + + // Native method; no parameter or return type inference available + entries(): any; + + // Native method; no parameter or return type inference available + forEach(p0: any): any; + + // Native method; no parameter or return type inference available + get(p0: any): any; + + // Native method; no parameter or return type inference available + has(p0: any): any; + + // Native method; no parameter or return type inference available + keys(): any; + + // Native method; no parameter or return type inference available + set(p0: any, p1: any): any; + + // Native method; no parameter or return type inference available + values(): any; + + } + + class MaxKey { + constructor(); + + inspect(): any; + + toExtendedJSON(): any; + + static fromExtendedJSON(): any; + + } + + class MinKey { + constructor(); + + inspect(): any; + + toExtendedJSON(): any; + + static fromExtendedJSON(): any; + + } + + class ObjectID { + constructor(inputId: any); + + equals(otherId: any): any; + + generate(...args: any[]): any; + + getInc(...args: any[]): any; + + getTimestamp(): any; + + get_inc(...args: any[]): any; + + inspect(): any; + + toExtendedJSON(): any; + + toHexString(): any; + + toJSON(): any; + + toString(format: any): any; + + static createFromHexString(hexString: any): any; + + static createFromTime(time: any): any; + + static createPk(): any; + + static fromExtendedJSON(doc: any): any; + + static generate(time: any): any; + + static getInc(): any; + + static get_inc(...args: any[]): any; + + static index: number; + + static isValid(id: any): any; + + } + + class ObjectId { + constructor(inputId: any); + + equals(otherId: any): any; + + generate(...args: any[]): any; + + getInc(...args: any[]): any; + + getTimestamp(): any; + + get_inc(...args: any[]): any; + + inspect(): any; + + toExtendedJSON(): any; + + toHexString(): any; + + toJSON(): any; + + toString(format: any): any; + + static createFromHexString(hexString: any): any; + + static createFromTime(time: any): any; + + static createPk(): any; + + static fromExtendedJSON(doc: any): any; + + static generate(time: any): any; + + static getInc(): any; + + static get_inc(...args: any[]): any; + + static index: number; + + static isValid(id: any): any; + + } + + class Timestamp { + constructor(low: any, high: any); + + inspect(): any; + + toExtendedJSON(): any; + + toJSON(): any; + + static fromBigInt(value: any, unsigned: any): any; + + static fromBits(lowBits: any, highBits: any): any; + + static fromBytes(bytes: any, unsigned: any, le: any): any; + + static fromBytesBE(bytes: any, unsigned: any): any; + + static fromBytesLE(bytes: any, unsigned: any): any; + + static fromExtendedJSON(doc: any): any; + + static fromInt(value: any): any; + + static fromNumber(value: any): any; + + static fromString(str: any, optRadix: any): any; + + static fromValue(val: any, unsigned: any): any; + + static isLong(value: any): any; + + } + + class UUID { + constructor(input: any); + + equals(otherId: any): any; + + inspect(): any; + + toBinary(): any; + + toHexString(includeDashes: any): any; + + toJSON(): any; + + toString(encoding: any): any; + + static BSON_BINARY_SUBTYPE_DEFAULT: number; + + static BUFFER_SIZE: number; + + static SUBTYPE_BYTE_ARRAY: number; + + static SUBTYPE_COLUMN: number; + + static SUBTYPE_DEFAULT: number; + + static SUBTYPE_ENCRYPTED: number; + + static SUBTYPE_FUNCTION: number; + + static SUBTYPE_MD5: number; + + static SUBTYPE_USER_DEFINED: number; + + static SUBTYPE_UUID: number; + + static SUBTYPE_UUID_OLD: number; + + static createFromHexString(hexString: any): any; + + static fromExtendedJSON(doc: any, options: any): any; + + static generate(): any; + + static isValid(input: any): any; + + } + + const BSON_BINARY_SUBTYPE_BYTE_ARRAY: number; + + const BSON_BINARY_SUBTYPE_COLUMN: number; + + const BSON_BINARY_SUBTYPE_DEFAULT: number; + + const BSON_BINARY_SUBTYPE_ENCRYPTED: number; + + const BSON_BINARY_SUBTYPE_FUNCTION: number; + + const BSON_BINARY_SUBTYPE_MD5: number; + + const BSON_BINARY_SUBTYPE_USER_DEFINED: number; + + const BSON_BINARY_SUBTYPE_UUID: number; + + const BSON_BINARY_SUBTYPE_UUID_NEW: number; + + const BSON_DATA_ARRAY: number; + + const BSON_DATA_BINARY: number; + + const BSON_DATA_BOOLEAN: number; + + const BSON_DATA_CODE: number; + + const BSON_DATA_CODE_W_SCOPE: number; + + const BSON_DATA_DATE: number; + + const BSON_DATA_DBPOINTER: number; + + const BSON_DATA_DECIMAL128: number; + + const BSON_DATA_INT: number; + + const BSON_DATA_LONG: number; + + const BSON_DATA_MAX_KEY: number; + + const BSON_DATA_MIN_KEY: number; + + const BSON_DATA_NULL: number; + + const BSON_DATA_NUMBER: number; + + const BSON_DATA_OBJECT: number; + + const BSON_DATA_OID: number; + + const BSON_DATA_REGEXP: number; + + const BSON_DATA_STRING: number; + + const BSON_DATA_SYMBOL: number; + + const BSON_DATA_TIMESTAMP: number; + + const BSON_DATA_UNDEFINED: number; + + const BSON_INT32_MAX: number; + + const BSON_INT32_MIN: number; + + const BSON_INT64_MAX: number; + + const BSON_INT64_MIN: number; + + function calculateObjectSize(object: any, options: any): any; + + function deserialize(buffer: any, options: any): any; + + function deserializeStream(data: any, startIndex: any, numberOfDocuments: any, documents: any, docStartIndex: any, options: any): any; + + function serialize(object: any, options: any): any; + + function serializeWithBufferAndIndex(object: any, finalBuffer: any, options: any): any; + + function setInternalBufferSize(size: any): void; + + namespace EJSON { + function deserialize(ejson: any, options: any): any; + + function parse(text: any, options: any): any; + + function serialize(value: any, options: any): any; + + function stringify(value: any, replacer: any, space: any, options: any): any; + + } + + namespace Long { + namespace MAX_UNSIGNED_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace MAX_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace MIN_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace NEG_ONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace ONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace TWO_PWR_24 { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace UONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace UZERO { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace ZERO { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + } + + namespace LongWithoutOverridesClass { + namespace MAX_UNSIGNED_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace MAX_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace MIN_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace NEG_ONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace ONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace TWO_PWR_24 { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace UONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace UZERO { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace ZERO { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + } + + namespace Timestamp { + namespace MAX_UNSIGNED_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace MAX_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace MIN_VALUE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace NEG_ONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace ONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace TWO_PWR_24 { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace UONE { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace UZERO { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + namespace ZERO { + const high: number; + + const low: number; + + const unsigned: boolean; + + function add(addend: any): any; + + function and(other: any): any; + + function comp(other: any): any; + + function compare(other: any): any; + + function div(divisor: any): any; + + function divide(divisor: any): any; + + function eq(other: any): any; + + function equals(other: any): any; + + function eqz(): any; + + function ge(other: any): any; + + function getHighBits(): any; + + function getHighBitsUnsigned(): any; + + function getLowBits(): any; + + function getLowBitsUnsigned(): any; + + function getNumBitsAbs(): any; + + function greaterThan(other: any): any; + + function greaterThanOrEqual(other: any): any; + + function gt(other: any): any; + + function gte(other: any): any; + + function inspect(): any; + + function isEven(): any; + + function isNegative(): any; + + function isOdd(): any; + + function isPositive(): any; + + function isZero(): any; + + function le(other: any): any; + + function lessThan(other: any): any; + + function lessThanOrEqual(other: any): any; + + function lt(other: any): any; + + function lte(other: any): any; + + function mod(divisor: any): any; + + function modulo(divisor: any): any; + + function mul(multiplier: any): any; + + function multiply(multiplier: any): any; + + function ne(other: any): any; + + function neg(): any; + + function negate(): any; + + function neq(other: any): any; + + function not(): any; + + function notEquals(other: any): any; + + function or(other: any): any; + + function rem(divisor: any): any; + + function shiftLeft(numBits: any): any; + + function shiftRight(numBits: any): any; + + function shiftRightUnsigned(numBits: any): any; + + function shl(numBits: any): any; + + function shr(numBits: any): any; + + function shr_u(numBits: any): any; + + function shru(numBits: any): any; + + function sub(subtrahend: any): any; + + function subtract(subtrahend: any): any; + + function toBigInt(): any; + + function toBytes(le: any): any; + + function toBytesBE(): any; + + function toBytesLE(): any; + + function toExtendedJSON(options: any): any; + + function toInt(): any; + + function toNumber(): any; + + function toSigned(): any; + + function toString(radix: any): any; + + function toUnsigned(): any; + + function xor(other: any): any; + + } + + } + +} + diff --git a/package.json b/package.json index 0d61c1f..5c5bc42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "hyperbeedeebee", - "version": "2.0.0", + "name": "hyperdeebee", + "version": "2.0.1", "description": "A MongoDB-like database built on top of Hyperbee with support for indexing", "main": "index.js", "scripts": { @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/RangerMauve/hyperbeedeebee.git" + "url": "git+https://github.com/Jampard/hyperdeebee.git" }, "keywords": [ "hyperbee", @@ -24,6 +24,7 @@ "url": "https://github.com/RangerMauve/hyperbeedeebee/issues" }, "homepage": "https://github.com/RangerMauve/hyperbeedeebee#readme", + "types": "index.d.ts", "dependencies": { "bson": "^4.3.0", "cbor": "^8.1.0" From 29b8f898b291530de08889b6e3f8cb776d29707f Mon Sep 17 00:00:00 2001 From: Jamps Date: Fri, 18 Nov 2022 12:02:18 +0100 Subject: [PATCH 6/6] feat: types and errors --- index.d.ts | 4491 ++++++++++++++++++++++++++-------------------------- index.js | 135 +- 2 files changed, 2324 insertions(+), 2302 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1ef1729..5f3e145 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4441 +1,4450 @@ /** Declaration file generated by dts-gen */ +export class NoDocumentSuppliedError extends Error { + constructor(message: string) +} +export class UniqueIntegrityConstraintViolationError extends Error { + constructor(message: string) +} + export class Collection { - constructor(...args: any[]); + constructor(...args: any[]); + + createIndex(...args: any[]): void; - createIndex(...args: any[]): void; + find(...args: any[]): Cursor; - find(...args: any[]): void; + findOne(...args: any[]): Promise; - findOne(...args: any[]): void; + delete(...args: any[]): Promise; - getIndex(...args: any[]): void; + getIndex(...args: any[]): void; - indexExists(...args: any[]): void; + indexExists(...args: any[]): void; - insert(...args: any[]): void; + insert(...args: T[]): Promise; - listIndexes(...args: any[]): void; + listIndexes(...args: any[]): void; - reIndex(...args: any[]): void; + reIndex(...args: any[]): void; - update(...args: any[]): void; + update(...args: any[]): { nMatched: number; nModified: number; nUpserted: number; }; } export class Cursor { - constructor(...args: any[]); + constructor(...args: any[]); - count(...args: any[]): void; + count(...args: any[]): number; - getIndex(...args: any[]): void; + getIndex(...args: any[]): void; - hint(...args: any[]): void; + hint(...args: any[]): Cursor; - limit(...args: any[]): void; + limit(...args: any[]): Cursor; - skip(...args: any[]): void; + skip(...args: any[]): Cursor; - sort(...args: any[]): void; + sort(...args: any[]): Cursor; - then(...args: any[]): void; + then(onfulfilled?: ((value: any) => TResult1 | Promise) | null | undefined, onrejected?: ((reason: any) => TResult2 | Promise) | null | undefined): Promise; } export class DB { - constructor(...args: any[]); + constructor(...args: any[]); - close(...args: any[]): void; + close(...args: any[]): void; - collection(...args: any[]): void; + collection(...args: any[]): Collection; } export namespace BSON { - class BSONError { - constructor(message: any); + class BSONError { + constructor(message: any); - static captureStackTrace(p0: any, p1: any): any; + static captureStackTrace(p0: any, p1: any): any; - static stackTraceLimit: number; + static stackTraceLimit: number; - } + } - class BSONRegExp { - constructor(pattern: any, options: any); + class BSONRegExp { + constructor(pattern: any, options: any); - toExtendedJSON(options: any): any; + toExtendedJSON(options: any): any; - static fromExtendedJSON(doc: any): any; + static fromExtendedJSON(doc: any): any; - static parseOptions(options: any): any; + static parseOptions(options: any): any; - } + } - class BSONSymbol { - constructor(value: any); + class BSONSymbol { + constructor(value: any); - inspect(): any; + inspect(): any; - toExtendedJSON(): any; + toExtendedJSON(): any; - toJSON(): any; + toJSON(): any; - toString(): any; + toString(): any; - valueOf(): any; + valueOf(): any; - static fromExtendedJSON(doc: any): any; + static fromExtendedJSON(doc: any): any; - } + } - class BSONTypeError { - constructor(message: any); + class BSONTypeError { + constructor(message: any); - static captureStackTrace(p0: any, p1: any): any; + static captureStackTrace(p0: any, p1: any): any; - static stackTraceLimit: number; + static stackTraceLimit: number; - } + } - class Binary { - constructor(buffer: any, subType: any); + class Binary { + constructor(buffer: any, subType: any); - inspect(): any; + inspect(): any; - length(): any; + length(): any; - put(byteValue: any): void; + put(byteValue: any): void; - read(position: any, length: any): any; + read(position: any, length: any): any; - toExtendedJSON(options: any): any; + toExtendedJSON(options: any): any; - toJSON(): any; + toJSON(): any; - toString(format: any): any; + toString(format: any): any; - toUUID(): any; + toUUID(): any; - value(asRaw: any): any; + value(asRaw: any): any; - write(sequence: any, offset: any): void; + write(sequence: any, offset: any): void; - static BSON_BINARY_SUBTYPE_DEFAULT: number; + static BSON_BINARY_SUBTYPE_DEFAULT: number; - static BUFFER_SIZE: number; + static BUFFER_SIZE: number; - static SUBTYPE_BYTE_ARRAY: number; + static SUBTYPE_BYTE_ARRAY: number; - static SUBTYPE_COLUMN: number; + static SUBTYPE_COLUMN: number; - static SUBTYPE_DEFAULT: number; + static SUBTYPE_DEFAULT: number; - static SUBTYPE_ENCRYPTED: number; + static SUBTYPE_ENCRYPTED: number; - static SUBTYPE_FUNCTION: number; + static SUBTYPE_FUNCTION: number; - static SUBTYPE_MD5: number; + static SUBTYPE_MD5: number; - static SUBTYPE_USER_DEFINED: number; + static SUBTYPE_USER_DEFINED: number; - static SUBTYPE_UUID: number; + static SUBTYPE_UUID: number; - static SUBTYPE_UUID_OLD: number; + static SUBTYPE_UUID_OLD: number; - static fromExtendedJSON(doc: any, options: any): any; + static fromExtendedJSON(doc: any, options: any): any; - } + } - class Code { - constructor(code: any, scope: any); + class Code { + constructor(code: any, scope: any); - inspect(): any; + inspect(): any; - toExtendedJSON(): any; + toExtendedJSON(): any; - toJSON(): any; + toJSON(): any; - static fromExtendedJSON(doc: any): any; + static fromExtendedJSON(doc: any): any; - } + } - class DBRef { - constructor(collection: any, oid: any, db: any, fields: any); + class DBRef { + constructor(collection: any, oid: any, db: any, fields: any); - inspect(): any; + inspect(): any; - toExtendedJSON(options: any): any; + toExtendedJSON(options: any): any; - toJSON(): any; + toJSON(): any; - static fromExtendedJSON(doc: any): any; + static fromExtendedJSON(doc: any): any; - } + } - class Decimal128 { - constructor(bytes: any); + class Decimal128 { + constructor(bytes: any); - inspect(): any; + inspect(): any; - toExtendedJSON(): any; + toExtendedJSON(): any; - toJSON(): any; + toJSON(): any; - toString(): any; + toString(): any; - static fromExtendedJSON(doc: any): any; + static fromExtendedJSON(doc: any): any; - static fromString(representation: any): any; + static fromString(representation: any): any; - } + } - class Double { - constructor(value: any); + class Double { + constructor(value: any); - inspect(): any; + inspect(): any; - toExtendedJSON(options: any): any; + toExtendedJSON(options: any): any; - toJSON(): any; + toJSON(): any; - toString(radix: any): any; + toString(radix: any): any; - valueOf(): any; + valueOf(): any; - static fromExtendedJSON(doc: any, options: any): any; + static fromExtendedJSON(doc: any, options: any): any; - } + } - class Int32 { - constructor(value: any); + class Int32 { + constructor(value: any); - inspect(): any; + inspect(): any; - toExtendedJSON(options: any): any; + toExtendedJSON(options: any): any; - toJSON(): any; + toJSON(): any; - toString(radix: any): any; + toString(radix: any): any; - valueOf(): any; + valueOf(): any; - static fromExtendedJSON(doc: any, options: any): any; + static fromExtendedJSON(doc: any, options: any): any; - } - - class Long { - constructor(low: any, high: any, unsigned: any); + } - add(addend: any): any; + class Long { + constructor(low: any, high: any, unsigned: any); - and(other: any): any; + add(addend: any): any; - comp(other: any): any; + and(other: any): any; - compare(other: any): any; + comp(other: any): any; - div(divisor: any): any; + compare(other: any): any; - divide(divisor: any): any; + div(divisor: any): any; - eq(other: any): any; + divide(divisor: any): any; - equals(other: any): any; + eq(other: any): any; - eqz(): any; + equals(other: any): any; - ge(other: any): any; + eqz(): any; - getHighBits(): any; + ge(other: any): any; - getHighBitsUnsigned(): any; + getHighBits(): any; - getLowBits(): any; + getHighBitsUnsigned(): any; - getLowBitsUnsigned(): any; + getLowBits(): any; - getNumBitsAbs(): any; + getLowBitsUnsigned(): any; - greaterThan(other: any): any; + getNumBitsAbs(): any; - greaterThanOrEqual(other: any): any; + greaterThan(other: any): any; - gt(other: any): any; + greaterThanOrEqual(other: any): any; - gte(other: any): any; + gt(other: any): any; - inspect(): any; + gte(other: any): any; - isEven(): any; + inspect(): any; - isNegative(): any; + isEven(): any; - isOdd(): any; + isNegative(): any; - isPositive(): any; + isOdd(): any; - isZero(): any; + isPositive(): any; - le(other: any): any; + isZero(): any; - lessThan(other: any): any; + le(other: any): any; - lessThanOrEqual(other: any): any; + lessThan(other: any): any; - lt(other: any): any; + lessThanOrEqual(other: any): any; - lte(other: any): any; + lt(other: any): any; - mod(divisor: any): any; + lte(other: any): any; - modulo(divisor: any): any; + mod(divisor: any): any; - mul(multiplier: any): any; + modulo(divisor: any): any; - multiply(multiplier: any): any; + mul(multiplier: any): any; - ne(other: any): any; + multiply(multiplier: any): any; - neg(): any; + ne(other: any): any; - negate(): any; + neg(): any; - neq(other: any): any; + negate(): any; - not(): any; + neq(other: any): any; - notEquals(other: any): any; + not(): any; - or(other: any): any; + notEquals(other: any): any; - rem(divisor: any): any; + or(other: any): any; - shiftLeft(numBits: any): any; + rem(divisor: any): any; - shiftRight(numBits: any): any; + shiftLeft(numBits: any): any; - shiftRightUnsigned(numBits: any): any; + shiftRight(numBits: any): any; - shl(numBits: any): any; + shiftRightUnsigned(numBits: any): any; - shr(numBits: any): any; + shl(numBits: any): any; - shr_u(numBits: any): any; + shr(numBits: any): any; - shru(numBits: any): any; + shr_u(numBits: any): any; - sub(subtrahend: any): any; + shru(numBits: any): any; - subtract(subtrahend: any): any; + sub(subtrahend: any): any; - toBigInt(): any; + subtract(subtrahend: any): any; - toBytes(le: any): any; + toBigInt(): any; - toBytesBE(): any; + toBytes(le: any): any; - toBytesLE(): any; + toBytesBE(): any; - toExtendedJSON(options: any): any; + toBytesLE(): any; - toInt(): any; + toExtendedJSON(options: any): any; - toNumber(): any; + toInt(): any; - toSigned(): any; + toNumber(): any; - toString(radix: any): any; + toSigned(): any; - toUnsigned(): any; + toString(radix: any): any; - xor(other: any): any; + toUnsigned(): any; - static fromBigInt(value: any, unsigned: any): any; + xor(other: any): any; - static fromBits(lowBits: any, highBits: any, unsigned: any): any; + static fromBigInt(value: any, unsigned: any): any; - static fromBytes(bytes: any, unsigned: any, le: any): any; + static fromBits(lowBits: any, highBits: any, unsigned: any): any; - static fromBytesBE(bytes: any, unsigned: any): any; + static fromBytes(bytes: any, unsigned: any, le: any): any; - static fromBytesLE(bytes: any, unsigned: any): any; + static fromBytesBE(bytes: any, unsigned: any): any; - static fromExtendedJSON(doc: any, options: any): any; + static fromBytesLE(bytes: any, unsigned: any): any; - static fromInt(value: any, unsigned: any): any; + static fromExtendedJSON(doc: any, options: any): any; - static fromNumber(value: any, unsigned: any): any; + static fromInt(value: any, unsigned: any): any; - static fromString(str: any, unsigned: any, radix: any): any; + static fromNumber(value: any, unsigned: any): any; - static fromValue(val: any, unsigned: any): any; + static fromString(str: any, unsigned: any, radix: any): any; - static isLong(value: any): any; + static fromValue(val: any, unsigned: any): any; - } + static isLong(value: any): any; - class LongWithoutOverridesClass { - constructor(low: any, high: any, unsigned: any); + } - add(addend: any): any; + class LongWithoutOverridesClass { + constructor(low: any, high: any, unsigned: any); - and(other: any): any; + add(addend: any): any; - comp(other: any): any; + and(other: any): any; - compare(other: any): any; + comp(other: any): any; - div(divisor: any): any; + compare(other: any): any; - divide(divisor: any): any; + div(divisor: any): any; - eq(other: any): any; + divide(divisor: any): any; - equals(other: any): any; + eq(other: any): any; - eqz(): any; + equals(other: any): any; - ge(other: any): any; + eqz(): any; - getHighBits(): any; + ge(other: any): any; - getHighBitsUnsigned(): any; + getHighBits(): any; - getLowBits(): any; + getHighBitsUnsigned(): any; - getLowBitsUnsigned(): any; + getLowBits(): any; - getNumBitsAbs(): any; + getLowBitsUnsigned(): any; - greaterThan(other: any): any; + getNumBitsAbs(): any; - greaterThanOrEqual(other: any): any; + greaterThan(other: any): any; - gt(other: any): any; + greaterThanOrEqual(other: any): any; - gte(other: any): any; + gt(other: any): any; - inspect(): any; + gte(other: any): any; - isEven(): any; + inspect(): any; - isNegative(): any; + isEven(): any; - isOdd(): any; + isNegative(): any; - isPositive(): any; + isOdd(): any; - isZero(): any; + isPositive(): any; - le(other: any): any; + isZero(): any; - lessThan(other: any): any; + le(other: any): any; - lessThanOrEqual(other: any): any; + lessThan(other: any): any; - lt(other: any): any; + lessThanOrEqual(other: any): any; - lte(other: any): any; + lt(other: any): any; - mod(divisor: any): any; + lte(other: any): any; - modulo(divisor: any): any; + mod(divisor: any): any; - mul(multiplier: any): any; + modulo(divisor: any): any; - multiply(multiplier: any): any; + mul(multiplier: any): any; - ne(other: any): any; + multiply(multiplier: any): any; - neg(): any; + ne(other: any): any; - negate(): any; + neg(): any; - neq(other: any): any; + negate(): any; - not(): any; + neq(other: any): any; - notEquals(other: any): any; + not(): any; - or(other: any): any; + notEquals(other: any): any; - rem(divisor: any): any; + or(other: any): any; - shiftLeft(numBits: any): any; + rem(divisor: any): any; - shiftRight(numBits: any): any; + shiftLeft(numBits: any): any; - shiftRightUnsigned(numBits: any): any; + shiftRight(numBits: any): any; - shl(numBits: any): any; + shiftRightUnsigned(numBits: any): any; - shr(numBits: any): any; + shl(numBits: any): any; - shr_u(numBits: any): any; + shr(numBits: any): any; - shru(numBits: any): any; + shr_u(numBits: any): any; - sub(subtrahend: any): any; + shru(numBits: any): any; - subtract(subtrahend: any): any; + sub(subtrahend: any): any; - toBigInt(): any; + subtract(subtrahend: any): any; - toBytes(le: any): any; + toBigInt(): any; - toBytesBE(): any; + toBytes(le: any): any; - toBytesLE(): any; + toBytesBE(): any; - toExtendedJSON(options: any): any; + toBytesLE(): any; - toInt(): any; + toExtendedJSON(options: any): any; - toNumber(): any; + toInt(): any; - toSigned(): any; + toNumber(): any; - toString(radix: any): any; + toSigned(): any; - toUnsigned(): any; + toString(radix: any): any; - xor(other: any): any; + toUnsigned(): any; - static fromBigInt(value: any, unsigned: any): any; + xor(other: any): any; - static fromBits(lowBits: any, highBits: any, unsigned: any): any; + static fromBigInt(value: any, unsigned: any): any; - static fromBytes(bytes: any, unsigned: any, le: any): any; + static fromBits(lowBits: any, highBits: any, unsigned: any): any; - static fromBytesBE(bytes: any, unsigned: any): any; + static fromBytes(bytes: any, unsigned: any, le: any): any; - static fromBytesLE(bytes: any, unsigned: any): any; + static fromBytesBE(bytes: any, unsigned: any): any; - static fromExtendedJSON(doc: any, options: any): any; + static fromBytesLE(bytes: any, unsigned: any): any; - static fromInt(value: any, unsigned: any): any; + static fromExtendedJSON(doc: any, options: any): any; - static fromNumber(value: any, unsigned: any): any; + static fromInt(value: any, unsigned: any): any; - static fromString(str: any, unsigned: any, radix: any): any; + static fromNumber(value: any, unsigned: any): any; - static fromValue(val: any, unsigned: any): any; + static fromString(str: any, unsigned: any, radix: any): any; - static isLong(value: any): any; + static fromValue(val: any, unsigned: any): any; - } + static isLong(value: any): any; - class Map { - constructor(); + } - // Native method; no parameter or return type inference available - clear(): any; + class Map { + constructor(); - // Native method; no parameter or return type inference available - delete(p0: any): any; + // Native method; no parameter or return type inference available + clear(): any; - // Native method; no parameter or return type inference available - entries(): any; + // Native method; no parameter or return type inference available + delete(p0: any): any; - // Native method; no parameter or return type inference available - forEach(p0: any): any; + // Native method; no parameter or return type inference available + entries(): any; - // Native method; no parameter or return type inference available - get(p0: any): any; + // Native method; no parameter or return type inference available + forEach(p0: any): any; - // Native method; no parameter or return type inference available - has(p0: any): any; + // Native method; no parameter or return type inference available + get(p0: any): any; - // Native method; no parameter or return type inference available - keys(): any; + // Native method; no parameter or return type inference available + has(p0: any): any; - // Native method; no parameter or return type inference available - set(p0: any, p1: any): any; + // Native method; no parameter or return type inference available + keys(): any; - // Native method; no parameter or return type inference available - values(): any; + // Native method; no parameter or return type inference available + set(p0: any, p1: any): any; - } + // Native method; no parameter or return type inference available + values(): any; - class MaxKey { - constructor(); + } - inspect(): any; + class MaxKey { + constructor(); - toExtendedJSON(): any; + inspect(): any; - static fromExtendedJSON(): any; + toExtendedJSON(): any; - } + static fromExtendedJSON(): any; - class MinKey { - constructor(); + } - inspect(): any; + class MinKey { + constructor(); - toExtendedJSON(): any; + inspect(): any; - static fromExtendedJSON(): any; + toExtendedJSON(): any; - } + static fromExtendedJSON(): any; - class ObjectID { - constructor(inputId: any); + } - equals(otherId: any): any; + class ObjectID { + constructor(inputId: any); - generate(...args: any[]): any; + equals(otherId: any): any; - getInc(...args: any[]): any; + generate(...args: any[]): any; - getTimestamp(): any; + getInc(...args: any[]): any; - get_inc(...args: any[]): any; + getTimestamp(): any; - inspect(): any; + get_inc(...args: any[]): any; - toExtendedJSON(): any; + inspect(): any; - toHexString(): any; + toExtendedJSON(): any; - toJSON(): any; + toHexString(): any; - toString(format: any): any; + toJSON(): any; - static createFromHexString(hexString: any): any; + toString(format: any): any; - static createFromTime(time: any): any; + static createFromHexString(hexString: any): any; - static createPk(): any; + static createFromTime(time: any): any; - static fromExtendedJSON(doc: any): any; + static createPk(): any; - static generate(time: any): any; + static fromExtendedJSON(doc: any): any; - static getInc(): any; + static generate(time: any): any; - static get_inc(...args: any[]): any; + static getInc(): any; - static index: number; + static get_inc(...args: any[]): any; - static isValid(id: any): any; + static index: number; - } + static isValid(id: any): any; - class ObjectId { - constructor(inputId: any); + } - equals(otherId: any): any; + class ObjectId { + constructor(inputId: any); - generate(...args: any[]): any; + equals(otherId: any): any; - getInc(...args: any[]): any; + generate(...args: any[]): any; - getTimestamp(): any; + getInc(...args: any[]): any; - get_inc(...args: any[]): any; + getTimestamp(): any; - inspect(): any; + get_inc(...args: any[]): any; - toExtendedJSON(): any; + inspect(): any; - toHexString(): any; + toExtendedJSON(): any; - toJSON(): any; + toHexString(): any; - toString(format: any): any; + toJSON(): any; - static createFromHexString(hexString: any): any; + toString(format: any): any; - static createFromTime(time: any): any; + static createFromHexString(hexString: any): any; - static createPk(): any; + static createFromTime(time: any): any; - static fromExtendedJSON(doc: any): any; + static createPk(): any; - static generate(time: any): any; + static fromExtendedJSON(doc: any): any; - static getInc(): any; + static generate(time: any): any; - static get_inc(...args: any[]): any; + static getInc(): any; - static index: number; + static get_inc(...args: any[]): any; - static isValid(id: any): any; + static index: number; - } + static isValid(id: any): any; - class Timestamp { - constructor(low: any, high: any); + } - inspect(): any; + class Timestamp { + constructor(low: any, high: any); - toExtendedJSON(): any; + inspect(): any; - toJSON(): any; + toExtendedJSON(): any; - static fromBigInt(value: any, unsigned: any): any; + toJSON(): any; - static fromBits(lowBits: any, highBits: any): any; + static fromBigInt(value: any, unsigned: any): any; - static fromBytes(bytes: any, unsigned: any, le: any): any; + static fromBits(lowBits: any, highBits: any): any; - static fromBytesBE(bytes: any, unsigned: any): any; + static fromBytes(bytes: any, unsigned: any, le: any): any; - static fromBytesLE(bytes: any, unsigned: any): any; + static fromBytesBE(bytes: any, unsigned: any): any; - static fromExtendedJSON(doc: any): any; + static fromBytesLE(bytes: any, unsigned: any): any; - static fromInt(value: any): any; + static fromExtendedJSON(doc: any): any; - static fromNumber(value: any): any; + static fromInt(value: any): any; - static fromString(str: any, optRadix: any): any; + static fromNumber(value: any): any; - static fromValue(val: any, unsigned: any): any; + static fromString(str: any, optRadix: any): any; - static isLong(value: any): any; + static fromValue(val: any, unsigned: any): any; - } + static isLong(value: any): any; - class UUID { - constructor(input: any); + } - equals(otherId: any): any; + class UUID { + constructor(input: any); - inspect(): any; + equals(otherId: any): any; - toBinary(): any; + inspect(): any; - toHexString(includeDashes: any): any; + toBinary(): any; - toJSON(): any; + toHexString(includeDashes: any): any; - toString(encoding: any): any; + toJSON(): any; - static BSON_BINARY_SUBTYPE_DEFAULT: number; + toString(encoding: any): any; - static BUFFER_SIZE: number; + static BSON_BINARY_SUBTYPE_DEFAULT: number; - static SUBTYPE_BYTE_ARRAY: number; + static BUFFER_SIZE: number; - static SUBTYPE_COLUMN: number; + static SUBTYPE_BYTE_ARRAY: number; - static SUBTYPE_DEFAULT: number; + static SUBTYPE_COLUMN: number; - static SUBTYPE_ENCRYPTED: number; + static SUBTYPE_DEFAULT: number; - static SUBTYPE_FUNCTION: number; + static SUBTYPE_ENCRYPTED: number; - static SUBTYPE_MD5: number; + static SUBTYPE_FUNCTION: number; - static SUBTYPE_USER_DEFINED: number; + static SUBTYPE_MD5: number; - static SUBTYPE_UUID: number; + static SUBTYPE_USER_DEFINED: number; - static SUBTYPE_UUID_OLD: number; + static SUBTYPE_UUID: number; - static createFromHexString(hexString: any): any; + static SUBTYPE_UUID_OLD: number; - static fromExtendedJSON(doc: any, options: any): any; + static createFromHexString(hexString: any): any; - static generate(): any; + static fromExtendedJSON(doc: any, options: any): any; - static isValid(input: any): any; + static generate(): any; - } + static isValid(input: any): any; - const BSON_BINARY_SUBTYPE_BYTE_ARRAY: number; + } - const BSON_BINARY_SUBTYPE_COLUMN: number; + const BSON_BINARY_SUBTYPE_BYTE_ARRAY: number; - const BSON_BINARY_SUBTYPE_DEFAULT: number; + const BSON_BINARY_SUBTYPE_COLUMN: number; - const BSON_BINARY_SUBTYPE_ENCRYPTED: number; + const BSON_BINARY_SUBTYPE_DEFAULT: number; - const BSON_BINARY_SUBTYPE_FUNCTION: number; + const BSON_BINARY_SUBTYPE_ENCRYPTED: number; - const BSON_BINARY_SUBTYPE_MD5: number; + const BSON_BINARY_SUBTYPE_FUNCTION: number; - const BSON_BINARY_SUBTYPE_USER_DEFINED: number; + const BSON_BINARY_SUBTYPE_MD5: number; - const BSON_BINARY_SUBTYPE_UUID: number; + const BSON_BINARY_SUBTYPE_USER_DEFINED: number; - const BSON_BINARY_SUBTYPE_UUID_NEW: number; + const BSON_BINARY_SUBTYPE_UUID: number; - const BSON_DATA_ARRAY: number; + const BSON_BINARY_SUBTYPE_UUID_NEW: number; - const BSON_DATA_BINARY: number; + const BSON_DATA_ARRAY: number; - const BSON_DATA_BOOLEAN: number; + const BSON_DATA_BINARY: number; - const BSON_DATA_CODE: number; + const BSON_DATA_BOOLEAN: number; - const BSON_DATA_CODE_W_SCOPE: number; + const BSON_DATA_CODE: number; - const BSON_DATA_DATE: number; + const BSON_DATA_CODE_W_SCOPE: number; - const BSON_DATA_DBPOINTER: number; + const BSON_DATA_DATE: number; - const BSON_DATA_DECIMAL128: number; + const BSON_DATA_DBPOINTER: number; - const BSON_DATA_INT: number; + const BSON_DATA_DECIMAL128: number; - const BSON_DATA_LONG: number; + const BSON_DATA_INT: number; - const BSON_DATA_MAX_KEY: number; + const BSON_DATA_LONG: number; - const BSON_DATA_MIN_KEY: number; + const BSON_DATA_MAX_KEY: number; - const BSON_DATA_NULL: number; + const BSON_DATA_MIN_KEY: number; - const BSON_DATA_NUMBER: number; + const BSON_DATA_NULL: number; - const BSON_DATA_OBJECT: number; + const BSON_DATA_NUMBER: number; - const BSON_DATA_OID: number; + const BSON_DATA_OBJECT: number; - const BSON_DATA_REGEXP: number; + const BSON_DATA_OID: number; - const BSON_DATA_STRING: number; + const BSON_DATA_REGEXP: number; - const BSON_DATA_SYMBOL: number; + const BSON_DATA_STRING: number; - const BSON_DATA_TIMESTAMP: number; + const BSON_DATA_SYMBOL: number; - const BSON_DATA_UNDEFINED: number; + const BSON_DATA_TIMESTAMP: number; - const BSON_INT32_MAX: number; + const BSON_DATA_UNDEFINED: number; - const BSON_INT32_MIN: number; + const BSON_INT32_MAX: number; - const BSON_INT64_MAX: number; + const BSON_INT32_MIN: number; - const BSON_INT64_MIN: number; + const BSON_INT64_MAX: number; - function calculateObjectSize(object: any, options: any): any; + const BSON_INT64_MIN: number; - function deserialize(buffer: any, options: any): any; + function calculateObjectSize(object: any, options: any): any; - function deserializeStream(data: any, startIndex: any, numberOfDocuments: any, documents: any, docStartIndex: any, options: any): any; + function deserialize(buffer: any, options: any): any; - function serialize(object: any, options: any): any; + function deserializeStream(data: any, startIndex: any, numberOfDocuments: any, documents: any, docStartIndex: any, options: any): any; - function serializeWithBufferAndIndex(object: any, finalBuffer: any, options: any): any; + function serialize(object: any, options: any): any; - function setInternalBufferSize(size: any): void; + function serializeWithBufferAndIndex(object: any, finalBuffer: any, options: any): any; - namespace EJSON { - function deserialize(ejson: any, options: any): any; + function setInternalBufferSize(size: any): void; - function parse(text: any, options: any): any; + namespace EJSON { + function deserialize(ejson: any, options: any): any; - function serialize(value: any, options: any): any; + function parse(text: any, options: any): any; - function stringify(value: any, replacer: any, space: any, options: any): any; + function serialize(value: any, options: any): any; - } + function stringify(value: any, replacer: any, space: any, options: any): any; - namespace Long { - namespace MAX_UNSIGNED_VALUE { - const high: number; + } - const low: number; + namespace Long { + namespace MAX_UNSIGNED_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace MAX_VALUE { - const high: number; + } - const low: number; + namespace MAX_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace MIN_VALUE { - const high: number; + } - const low: number; + namespace MIN_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace NEG_ONE { - const high: number; + } - const low: number; + namespace NEG_ONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace ONE { - const high: number; + } - const low: number; + namespace ONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace TWO_PWR_24 { - const high: number; + } - const low: number; + namespace TWO_PWR_24 { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace UONE { - const high: number; + } - const low: number; + namespace UONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace UZERO { - const high: number; + } - const low: number; + namespace UZERO { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace ZERO { - const high: number; + } - const low: number; + namespace ZERO { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; } - namespace LongWithoutOverridesClass { - namespace MAX_UNSIGNED_VALUE { - const high: number; + } - const low: number; + namespace LongWithoutOverridesClass { + namespace MAX_UNSIGNED_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace MAX_VALUE { - const high: number; + } - const low: number; + namespace MAX_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace MIN_VALUE { - const high: number; + } - const low: number; + namespace MIN_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace NEG_ONE { - const high: number; + } - const low: number; + namespace NEG_ONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace ONE { - const high: number; + } - const low: number; + namespace ONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace TWO_PWR_24 { - const high: number; + } - const low: number; + namespace TWO_PWR_24 { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace UONE { - const high: number; + } - const low: number; + namespace UONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace UZERO { - const high: number; + } - const low: number; + namespace UZERO { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace ZERO { - const high: number; + } - const low: number; + namespace ZERO { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; } - namespace Timestamp { - namespace MAX_UNSIGNED_VALUE { - const high: number; + } - const low: number; + namespace Timestamp { + namespace MAX_UNSIGNED_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace MAX_VALUE { - const high: number; + } - const low: number; + namespace MAX_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace MIN_VALUE { - const high: number; + } - const low: number; + namespace MIN_VALUE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace NEG_ONE { - const high: number; + } - const low: number; + namespace NEG_ONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace ONE { - const high: number; + } - const low: number; + namespace ONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace TWO_PWR_24 { - const high: number; + } - const low: number; + namespace TWO_PWR_24 { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace UONE { - const high: number; + } - const low: number; + namespace UONE { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace UZERO { - const high: number; + } - const low: number; + namespace UZERO { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; - namespace ZERO { - const high: number; + } - const low: number; + namespace ZERO { + const high: number; - const unsigned: boolean; + const low: number; - function add(addend: any): any; + const unsigned: boolean; - function and(other: any): any; + function add(addend: any): any; - function comp(other: any): any; + function and(other: any): any; - function compare(other: any): any; + function comp(other: any): any; - function div(divisor: any): any; + function compare(other: any): any; - function divide(divisor: any): any; + function div(divisor: any): any; - function eq(other: any): any; + function divide(divisor: any): any; - function equals(other: any): any; + function eq(other: any): any; - function eqz(): any; + function equals(other: any): any; - function ge(other: any): any; + function eqz(): any; - function getHighBits(): any; + function ge(other: any): any; - function getHighBitsUnsigned(): any; + function getHighBits(): any; - function getLowBits(): any; + function getHighBitsUnsigned(): any; - function getLowBitsUnsigned(): any; + function getLowBits(): any; - function getNumBitsAbs(): any; + function getLowBitsUnsigned(): any; - function greaterThan(other: any): any; + function getNumBitsAbs(): any; - function greaterThanOrEqual(other: any): any; + function greaterThan(other: any): any; - function gt(other: any): any; + function greaterThanOrEqual(other: any): any; - function gte(other: any): any; + function gt(other: any): any; - function inspect(): any; + function gte(other: any): any; - function isEven(): any; + function inspect(): any; - function isNegative(): any; + function isEven(): any; - function isOdd(): any; + function isNegative(): any; - function isPositive(): any; + function isOdd(): any; - function isZero(): any; + function isPositive(): any; - function le(other: any): any; + function isZero(): any; - function lessThan(other: any): any; + function le(other: any): any; - function lessThanOrEqual(other: any): any; + function lessThan(other: any): any; - function lt(other: any): any; + function lessThanOrEqual(other: any): any; - function lte(other: any): any; + function lt(other: any): any; - function mod(divisor: any): any; + function lte(other: any): any; - function modulo(divisor: any): any; + function mod(divisor: any): any; - function mul(multiplier: any): any; + function modulo(divisor: any): any; - function multiply(multiplier: any): any; + function mul(multiplier: any): any; - function ne(other: any): any; + function multiply(multiplier: any): any; - function neg(): any; + function ne(other: any): any; - function negate(): any; + function neg(): any; - function neq(other: any): any; + function negate(): any; - function not(): any; + function neq(other: any): any; - function notEquals(other: any): any; + function not(): any; - function or(other: any): any; + function notEquals(other: any): any; - function rem(divisor: any): any; + function or(other: any): any; - function shiftLeft(numBits: any): any; + function rem(divisor: any): any; - function shiftRight(numBits: any): any; + function shiftLeft(numBits: any): any; - function shiftRightUnsigned(numBits: any): any; + function shiftRight(numBits: any): any; - function shl(numBits: any): any; + function shiftRightUnsigned(numBits: any): any; - function shr(numBits: any): any; + function shl(numBits: any): any; - function shr_u(numBits: any): any; + function shr(numBits: any): any; - function shru(numBits: any): any; + function shr_u(numBits: any): any; - function sub(subtrahend: any): any; + function shru(numBits: any): any; - function subtract(subtrahend: any): any; + function sub(subtrahend: any): any; - function toBigInt(): any; + function subtract(subtrahend: any): any; - function toBytes(le: any): any; + function toBigInt(): any; - function toBytesBE(): any; + function toBytes(le: any): any; - function toBytesLE(): any; + function toBytesBE(): any; - function toExtendedJSON(options: any): any; + function toBytesLE(): any; - function toInt(): any; + function toExtendedJSON(options: any): any; - function toNumber(): any; + function toInt(): any; - function toSigned(): any; + function toNumber(): any; - function toString(radix: any): any; + function toSigned(): any; - function toUnsigned(): any; + function toString(radix: any): any; - function xor(other: any): any; + function toUnsigned(): any; - } + function xor(other: any): any; } + } + } diff --git a/index.js b/index.js index 93734bf..939eb6a 100644 --- a/index.js +++ b/index.js @@ -42,13 +42,26 @@ const UPDATE_TYPES = { $push: updatePush } +class NoDocumentSuppliedError extends Error { + constructor(message) { + super(message) + this.name = this.constructor.name; + } +} +class UniqueIntegrityConstraintViolationError extends Error { + constructor(message) { + super(message) + this.name = this.constructor.name; + } +} + class DB { - constructor (bee) { + constructor(bee) { this.bee = bee this.collections = new Map() } - collection (name) { + collection(name) { if (!this.collections.has(name)) { const sub = this.bee.sub(name) const collection = new Collection(name, sub) @@ -58,14 +71,14 @@ class DB { return this.collections.get(name) } - async close () { + async close() { // TODO: This looks kinda stange. PR a close method on bee? return this.bee.close() } } class Collection { - constructor (name, bee) { + constructor(name, bee) { this.name = name this.bee = bee this.docs = bee.sub('doc') @@ -73,9 +86,9 @@ class Collection { this.idx = bee.sub('idx') } - async insert (rawDoc) { + async insert(rawDoc) { let doc = rawDoc - if (!doc) throw new TypeError('No Document Supplied') + if (!doc) throw new NoDocumentSuppliedError('No Document Supplied') if (!doc._id) { doc = { ...doc, @@ -88,7 +101,7 @@ class Collection { const exists = await this.docs.get(key) - if (exists) throw new Error('Duplicate Key error, try using .update?') + if (exists) throw new UniqueIntegrityConstraintViolationError('Duplicate Key error, try using .update?') const value = BSON.serialize(doc) @@ -106,7 +119,7 @@ class Collection { return doc } - async update (query = {}, update = {}, options = {}) { + async update(query = {}, update = {}, options = {}) { const { upsert = false, multi = false, hint = null } = options let nMatched = 0 @@ -162,7 +175,7 @@ class Collection { } } - async delete (query = {}, options = {}) { + async delete(query = {}, options = {}) { const { multi = false, hint = null } = options let nDeleted = 0 @@ -193,7 +206,7 @@ class Collection { } } - async findOne (query = {}) { + async findOne(query = {}) { const results = await this.find(query).limit(1) const [doc] = results @@ -203,11 +216,11 @@ class Collection { return doc } - find (query = {}) { + find(query = {}) { return new Cursor(query, this) } - async createIndex ( + async createIndex( fields, { rebuild = false, version = INDEX_VERSION, ...opts } = {} ) { @@ -237,18 +250,18 @@ class Collection { return name } - async indexExists (name) { + async indexExists(name) { const exists = await this.idxs.get(name) return exists !== null } - async getIndex (name) { + async getIndex(name) { const data = await this.idxs.get(name) if (!data) throw new Error('Invalid index') return BSON.deserialize(data.value) } - async reIndex (name) { + async reIndex(name) { const { fields } = await this.getIndex(name) // TODO: Cache index subs const bee = this.idx.sub(name) @@ -259,7 +272,7 @@ class Collection { } // This is a private API, don't depend on it - async _indexDocument (bee, fields, doc) { + async _indexDocument(bee, fields, doc) { if (!hasFields(doc, fields)) return const idxValue = doc._id.id @@ -273,7 +286,7 @@ class Collection { await batch.flush() } - async _deIndexDocument (bee, fields, doc) { + async _deIndexDocument(bee, fields, doc) { if (!hasFields(doc, fields)) return const batch = bee.batch() @@ -287,7 +300,7 @@ class Collection { } // TODO: Cache indexes? - async listIndexes () { + async listIndexes() { const stream = this.idxs.createReadStream() const indexes = [] @@ -301,7 +314,7 @@ class Collection { } class Cursor { - constructor ( + constructor( query = {}, collection, opts = { @@ -317,7 +330,7 @@ class Cursor { this.opts = opts } - async count () { + async count() { let count = 0 // Item isn't being used but eslint will complain about it for await (const item of this) { // eslint-disable-line @@ -327,19 +340,19 @@ class Cursor { return count } - hint (hint) { + hint(hint) { return new Cursor(this.query, this.collection, { ...this.opts, hint }) } - limit (limit) { + limit(limit) { return new Cursor(this.query, this.collection, { ...this.opts, limit }) } - skip (skip) { + skip(skip) { return new Cursor(this.query, this.collection, { ...this.opts, skip }) } - sort (field, direction = 1) { + sort(field, direction = 1) { return new Cursor(this.query, this.collection, { ...this.opts, sort: { @@ -349,7 +362,7 @@ class Cursor { }) } - async getIndex () { + async getIndex() { const { sort, hint } = this.opts const query = this.query @@ -433,7 +446,7 @@ class Cursor { } } - async then (resolve, reject) { + async then(resolve, reject) { try { const results = [] for await (const item of this) { @@ -445,7 +458,7 @@ class Cursor { } } - async * [Symbol.asyncIterator] () { + async *[Symbol.asyncIterator]() { if (this.query._id && this.query._id instanceof ObjectID) { // Doc IDs are unique, so we can query against them without doing a search const key = this.query._id.id @@ -477,7 +490,7 @@ class Cursor { const bestIndex = await this.getIndex() - function processDoc (doc) { + function processDoc(doc) { let shouldYield = null let shouldBreak = false @@ -579,7 +592,7 @@ class Cursor { } } -function performUpdate (doc, update) { +function performUpdate(doc, update) { if (Array.isArray(update)) { return update.reduce(performUpdate, doc) } @@ -594,7 +607,7 @@ function performUpdate (doc, update) { return newDoc } -function matchesQuery (doc, query) { +function matchesQuery(doc, query) { for (const key of Object.keys(query)) { const queryValue = query[key] const docValue = doc[key] @@ -603,7 +616,7 @@ function matchesQuery (doc, query) { return true } -function queryCompare (docValue, queryValue) { +function queryCompare(docValue, queryValue) { if (isQueryObject(queryValue)) { for (const queryType of Object.keys(queryValue)) { const compare = QUERY_TYPES[queryType] @@ -615,7 +628,7 @@ function queryCompare (docValue, queryValue) { } else return compareEq(docValue, queryValue) } -function compareAll (docValue, queryValue) { +function compareAll(docValue, queryValue) { // TODO: Add query validator function to detect this early. if (!Array.isArray(queryValue)) { throw new Error('$all must be set to an array') @@ -629,7 +642,7 @@ function compareAll (docValue, queryValue) { } } -function compareIn (docValue, queryValue) { +function compareIn(docValue, queryValue) { // TODO: Add query validator function to detect this early. if (!Array.isArray(queryValue)) { throw new Error('$in must be set to an array') @@ -643,32 +656,32 @@ function compareIn (docValue, queryValue) { } } -function compareGt (docValue, queryValue) { +function compareGt(docValue, queryValue) { return ensureComparable(docValue) > ensureComparable(queryValue) } -function compareLt (docValue, queryValue) { +function compareLt(docValue, queryValue) { return ensureComparable(docValue) < ensureComparable(queryValue) } -function compareGte (docValue, queryValue) { +function compareGte(docValue, queryValue) { return ensureComparable(docValue) >= ensureComparable(queryValue) } -function compareLte (docValue, queryValue) { +function compareLte(docValue, queryValue) { return ensureComparable(docValue) <= ensureComparable(queryValue) } -function compareNe (docValue, queryValue) { +function compareNe(docValue, queryValue) { return ensureComparable(docValue) !== ensureComparable(queryValue) } -function ensureComparable (value) { +function ensureComparable(value) { if (value instanceof Date) return value.getTime() return value } -function compareEq (docValue, queryValue) { +function compareEq(docValue, queryValue) { if (Array.isArray(docValue)) { return docValue.some((item) => compareEq(item, queryValue)) } else if (typeof docValue?.equals === 'function') { @@ -678,11 +691,11 @@ function compareEq (docValue, queryValue) { } } -function compareExists (docValue, queryValue) { +function compareExists(docValue, queryValue) { return (docValue !== undefined) === queryValue } -function updatePull (doc, fields) { +function updatePull(doc, fields) { for (const key of Object.keys(fields)) { const value = doc[key] if (!Array.isArray(value)) continue @@ -692,7 +705,7 @@ function updatePull (doc, fields) { } } -function updatePop (doc, fields) { +function updatePop(doc, fields) { for (const key of Object.keys(fields)) { const value = doc[key] if (!Array.isArray(value)) continue @@ -705,7 +718,7 @@ function updatePop (doc, fields) { } } -function updatePush (doc, fields) { +function updatePush(doc, fields) { for (const key of Object.keys(fields)) { const toPush = fields[key] if (!(key in doc)) { @@ -725,7 +738,7 @@ function updatePush (doc, fields) { } } -function updateAddToSet (doc, fields) { +function updateAddToSet(doc, fields) { for (const key of Object.keys(fields)) { if (!(key in doc)) { doc[key] = fields[key] @@ -745,19 +758,19 @@ function updateAddToSet (doc, fields) { } } -function updateUnset (doc, fields) { +function updateUnset(doc, fields) { for (const key of Object.keys(fields)) { delete doc[key] } } -function updateSet (doc, fields) { +function updateSet(doc, fields) { for (const key of Object.keys(fields)) { doc[key] = fields[key] } } -function updateRename (doc, fields) { +function updateRename(doc, fields) { for (const key of Object.keys(fields)) { if (!(key in doc)) continue const name = fields[key] @@ -767,7 +780,7 @@ function updateRename (doc, fields) { } } -function updateInc (doc, fields) { +function updateInc(doc, fields) { for (const key of Object.keys(fields)) { const value = fields[key] if (!(key in doc)) { @@ -778,7 +791,7 @@ function updateInc (doc, fields) { } } -function updateMul (doc, fields) { +function updateMul(doc, fields) { for (const key of Object.keys(fields)) { const value = fields[key] if (!(key in doc)) { @@ -789,11 +802,11 @@ function updateMul (doc, fields) { } } -function hasFields (doc, fields) { +function hasFields(doc, fields) { return fields.every((field) => field in doc && field !== undefined) } -function makeIndexKeyV1 (doc, fields) { +function makeIndexKeyV1(doc, fields) { // TODO: Does BSON array work well for ordering? // TODO: Maybe use a custom encoding? // Serialize the data into a BSON array @@ -811,7 +824,7 @@ function makeIndexKeyV1 (doc, fields) { return noPrefix } -function makeDocFromIndexV1 (key, fields) { +function makeDocFromIndexV1(key, fields) { const buffer = Buffer.alloc(key.length + 4) key.copy(buffer, 4) // Write a valid length prefix to the buffer for BSON decoding @@ -829,7 +842,7 @@ function makeDocFromIndexV1 (key, fields) { return doc } -function makeIndexKeyV2 (doc, fields, allFields = fields) { +function makeIndexKeyV2(doc, fields, allFields = fields) { // CBOR encode fields const keyValues = fields.map((field) => { const value = doc[field] @@ -860,7 +873,7 @@ function makeIndexKeyV2 (doc, fields, allFields = fields) { return key } -function makeDocFromIndexV2 (key, fields) { +function makeDocFromIndexV2(key, fields) { // CBOR decode fields const decoded = cbor.decode(key) const doc = {} @@ -881,7 +894,7 @@ function makeDocFromIndexV2 (key, fields) { return doc } -function getSubset (doc, fields) { +function getSubset(doc, fields) { return fields.reduce((res, field) => { if (field in doc) { res[field] = doc[field] @@ -890,7 +903,7 @@ function getSubset (doc, fields) { }, {}) } -function * flattenDocument (doc, fields) { +function* flattenDocument(doc, fields) { let hadArray = false for (const key of fields) { @@ -913,7 +926,7 @@ function * flattenDocument (doc, fields) { if (!hadArray) yield doc } -function makeIndexKeyFromQuery (query, fields, indexFields, makeIndexKey) { +function makeIndexKeyFromQuery(query, fields, indexFields, makeIndexKey) { // TODO: Account for $eq and $gt fields const doc = fields.reduce((res, field) => { const value = query[field] @@ -934,15 +947,15 @@ function makeIndexKeyFromQuery (query, fields, indexFields, makeIndexKey) { return makeIndexKey(doc, fields, indexFields) } -function isQueryObject (object) { +function isQueryObject(object) { return typeof object === 'object' && has$Keys(object) } -function has$Keys (object) { +function has$Keys(object) { return Object.keys(object).some((key) => key.startsWith('$')) } -function consecutiveSubset (origin, values) { +function consecutiveSubset(origin, values) { let counter = 0 for (const item of origin) { if (!values.includes(item)) return counter