librasn / compiler

An ASN1 compiler producing Rust bindings for the rasn framework
Other
10 stars 7 forks source link

typescript: export namespaces #25

Closed dmtarua closed 3 months ago

dmtarua commented 3 months ago

Currently, generated TS namespaces are not exported, limiting their usage to TS's global namespaces.

This pull request allows to deal with namespaces that have different contents but share the same name, as the following example describes:

import { CAM_PDU_Descriptions as CAM_PDU_Descriptions_V1} from "./types/cam_v1";
import { CAM_PDU_Descriptions as CAM_PDU_Descriptions_V2} from "./types/cam_v2";

type CAM_V1 = CAM_PDU_Descriptions_V1.CAM
type CAM_V2 = CAM_PDU_Descriptions_V2.CAM