import { AnyId , Value } from './core' ; export type ValueCallback = ( ) => number | Buffer ; declare module './core' { interface AnyId { of ( f ) : AnyId ; } } class FunctionValue extends Value { constructor ( owner , private f ) { super ( owner ) ; } value ( ) { return this . returnValue ( this . f ( ) ) ; } } export class Func { of ( this , f ) { this . addValue ( new FunctionValue ( this , f ) ) ; return this ; } }