X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=typescript_strings.py;h=dccd8cf3a8d9b0a0133868df8ca5e66818bfe708;hb=55918fad1311e286d1698576e4ba163ab55f815b;hp=70e37331ba56db6230a7e39f6b2511f069ede9e7;hpb=9f83f85543a3957adf458d613834839ace40fe71;p=ldk-java diff --git a/typescript_strings.py b/typescript_strings.py index 70e37331..dccd8cf3 100644 --- a/typescript_strings.py +++ b/typescript_strings.py @@ -1,5 +1,14 @@ class Consts: def __init__(self, DEBUG): + self.common_base = """ + export default class CommonBase { + ptr: number; + ptrs_to: object[] = new Array(); // new LinkedList(); TODO: build linked list implementation + protected constructor(ptr: number) { this.ptr = ptr; } + public _test_only_get_ptr(): number { return this.ptr; } + } + """ + self.c_file_pfx = """#include #include #include @@ -129,14 +138,10 @@ typedef bool jboolean; """ - self.hu_struct_file_prefix = """package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; + self.hu_struct_file_prefix = f""" +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location -@SuppressWarnings("unchecked") // We correctly assign various generic arrays """ self.c_fn_ty_pfx = "" self.c_fn_name_pfx = ""