@chainsafe/ssz-type-schema
Version:
Utility methods and types for describing an ssz object
58 lines (51 loc) • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.byte = exports.bit = exports.UintImpl = exports.Type = void 0;
/* eslint-disable @typescript-eslint/interface-name-prefix, @typescript-eslint/no-explicit-any */
// Serializable values
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// Simple types
// These types are supplied to provide a convenient interface with which to specify types
/**
* A convenient interface for specifying types
*
* In most cases, types are specified by users in simple form.
* They will be parsed to a [[FullSSZType]] before any processing.
*/
// Full types
// These types are used internally
let Type;
exports.Type = Type;
(function (Type) {
Type[Type["uint"] = 0] = "uint";
Type[Type["bool"] = 1] = "bool";
Type[Type["bitList"] = 2] = "bitList";
Type[Type["bitVector"] = 3] = "bitVector";
Type[Type["byteList"] = 4] = "byteList";
Type[Type["byteVector"] = 5] = "byteVector";
Type[Type["list"] = 6] = "list";
Type[Type["vector"] = 7] = "vector";
Type[Type["container"] = 8] = "container";
})(Type || (exports.Type = Type = {}));
let UintImpl;
exports.UintImpl = UintImpl;
(function (UintImpl) {
UintImpl["number"] = "number";
UintImpl["bigint"] = "bigint";
UintImpl["bn"] = "bn";
})(UintImpl || (exports.UintImpl = UintImpl = {}));
// useful primitive types
const bit = {
type: Type.bool
};
exports.bit = bit;
const byte = {
type: Type.uint,
byteLength: 1,
use: "number"
};
exports.byte = byte;
//# sourceMappingURL=types.js.map