3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export class Score extends CommonBase {
10 bindings_instance?: bindings.LDKScore;
12 constructor(ptr?: number, arg?: bindings.LDKScore) {
13 if (Number.isFinite(ptr)) {
15 this.bindings_instance = null;
17 // TODO: private constructor instantiation
18 super(bindings.LDKScore_new(arg));
19 this.ptrs_to.push(arg);
24 protected finalize() {
26 bindings.Score_free(this.ptr);
31 static new_impl(arg: ScoreInterface): Score {
32 const impl_holder: LDKScoreHolder = new LDKScoreHolder();
33 let structImplementation = <bindings.LDKScore>{
34 // todo: in-line interface filling
35 channel_penalty_msat (short_channel_id: number): number {
36 number ret = arg.channel_penalty_msat(short_channel_id);
42 impl_holder.held = new Score (null, structImplementation);
46 export interface ScoreInterface {
47 channel_penalty_msat(short_channel_id: number): number;
51 class LDKScoreHolder {
54 public number channel_penalty_msat(number short_channel_id) {
55 number ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id);