export const EOF = Symbol('End Of File') export enum PrimitiveSymbol { u8, u16, u24, u32, u64, i8, i16, i24, i32, i64, float32, float64, } /** * The execution scope defines in which part of the binary processing (read, * write or both). */ export enum ExecutionScope { OnRead = 0x01, OnWrite = 0x02, OnBoth = 0x03, } /** * isPrimitiveSymbol. * * @param {any} x * @returns {x is PrimitiveSymbol} */ export function isPrimitiveSymbol (x: any): x is PrimitiveSymbol { return Object.prototype.hasOwnProperty.call(PrimitiveSymbol, x) } export type DecoratorMetadataObject = Record /** * Context */ export type Context = | ClassAccessorDecoratorContext | ClassGetterDecoratorContext | ClassFieldDecoratorContext /** * DecoratorType. */ export type DecoratorType = (target: undefined, context: Context) => void export type ClassAndPropertyDecoratorContext = ClassDecoratorContext This> | Context export type ClassAndPropertyDecoratorType = (target: any, context: ClassAndPropertyDecoratorContext) => void /** * InstantiableObject. */ export type InstantiableObject = (new (...args: any[]) => Target) export type Primitive = InstantiableObject | PrimitiveSymbol