objdiff-wasm 2.0.0-beta.5 → 2.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.d.ts CHANGED
@@ -619,304 +619,6 @@ interface DiffResult {
619
619
  * @generated MessageType for protobuf message objdiff.diff.DiffResult
620
620
  */
621
621
  declare const DiffResult: DiffResult$Type;
622
- declare class DiffDisplay$Type extends MessageType<DiffDisplay> {
623
- constructor();
624
- create(value?: PartialMessage<DiffDisplay>): DiffDisplay;
625
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffDisplay): DiffDisplay;
626
- internalBinaryWrite(message: DiffDisplay, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
627
- }
628
- /**
629
- * @generated from protobuf message objdiff.diff.DiffDisplay
630
- */
631
- interface DiffDisplay {
632
- /**
633
- * @generated from protobuf field: objdiff.diff.DiffText text = 1;
634
- */
635
- text?: DiffText;
636
- /**
637
- * @generated from protobuf field: optional uint32 diff_index = 2;
638
- */
639
- diff_index?: number;
640
- }
641
- /**
642
- * @generated MessageType for protobuf message objdiff.diff.DiffDisplay
643
- */
644
- declare const DiffDisplay: DiffDisplay$Type;
645
- declare class DiffText$Type extends MessageType<DiffText> {
646
- constructor();
647
- create(value?: PartialMessage<DiffText>): DiffText;
648
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffText): DiffText;
649
- internalBinaryWrite(message: DiffText, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
650
- }
651
- /**
652
- * @generated from protobuf message objdiff.diff.DiffText
653
- */
654
- interface DiffText {
655
- /**
656
- * @generated from protobuf oneof: text
657
- */
658
- text: {
659
- oneofKind: "basic";
660
- /**
661
- * @generated from protobuf field: objdiff.diff.DiffTextBasic basic = 1;
662
- */
663
- basic: DiffTextBasic;
664
- } | {
665
- oneofKind: "basic_color";
666
- /**
667
- * @generated from protobuf field: objdiff.diff.DiffTextBasicColor basic_color = 2;
668
- */
669
- basic_color: DiffTextBasicColor;
670
- } | {
671
- oneofKind: "line";
672
- /**
673
- * @generated from protobuf field: objdiff.diff.DiffTextLine line = 3;
674
- */
675
- line: DiffTextLine;
676
- } | {
677
- oneofKind: "address";
678
- /**
679
- * @generated from protobuf field: objdiff.diff.DiffTextAddress address = 4;
680
- */
681
- address: DiffTextAddress;
682
- } | {
683
- oneofKind: "opcode";
684
- /**
685
- * @generated from protobuf field: objdiff.diff.DiffTextOpcode opcode = 5;
686
- */
687
- opcode: DiffTextOpcode;
688
- } | {
689
- oneofKind: "argument";
690
- /**
691
- * @generated from protobuf field: objdiff.diff.DiffTextArgument argument = 6;
692
- */
693
- argument: DiffTextArgument;
694
- } | {
695
- oneofKind: "branch_dest";
696
- /**
697
- * @generated from protobuf field: objdiff.diff.DiffTextBranchDest branch_dest = 7;
698
- */
699
- branch_dest: DiffTextBranchDest;
700
- } | {
701
- oneofKind: "symbol";
702
- /**
703
- * @generated from protobuf field: objdiff.diff.DiffTextSymbol symbol = 8;
704
- */
705
- symbol: DiffTextSymbol;
706
- } | {
707
- oneofKind: "spacing";
708
- /**
709
- * @generated from protobuf field: objdiff.diff.DiffTextSpacing spacing = 9;
710
- */
711
- spacing: DiffTextSpacing;
712
- } | {
713
- oneofKind: "eol";
714
- /**
715
- * @generated from protobuf field: objdiff.diff.DiffTextEol eol = 10;
716
- */
717
- eol: DiffTextEol;
718
- } | {
719
- oneofKind: undefined;
720
- };
721
- }
722
- /**
723
- * @generated MessageType for protobuf message objdiff.diff.DiffText
724
- */
725
- declare const DiffText: DiffText$Type;
726
- declare class DiffTextBasic$Type extends MessageType<DiffTextBasic> {
727
- constructor();
728
- create(value?: PartialMessage<DiffTextBasic>): DiffTextBasic;
729
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextBasic): DiffTextBasic;
730
- internalBinaryWrite(message: DiffTextBasic, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
731
- }
732
- /**
733
- * @generated from protobuf message objdiff.diff.DiffTextBasic
734
- */
735
- interface DiffTextBasic {
736
- /**
737
- * @generated from protobuf field: string text = 1;
738
- */
739
- text: string;
740
- }
741
- /**
742
- * @generated MessageType for protobuf message objdiff.diff.DiffTextBasic
743
- */
744
- declare const DiffTextBasic: DiffTextBasic$Type;
745
- declare class DiffTextBasicColor$Type extends MessageType<DiffTextBasicColor> {
746
- constructor();
747
- create(value?: PartialMessage<DiffTextBasicColor>): DiffTextBasicColor;
748
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextBasicColor): DiffTextBasicColor;
749
- internalBinaryWrite(message: DiffTextBasicColor, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
750
- }
751
- /**
752
- * @generated from protobuf message objdiff.diff.DiffTextBasicColor
753
- */
754
- interface DiffTextBasicColor {
755
- /**
756
- * @generated from protobuf field: string text = 1;
757
- */
758
- text: string;
759
- /**
760
- * @generated from protobuf field: uint32 index = 2;
761
- */
762
- index: number;
763
- }
764
- /**
765
- * @generated MessageType for protobuf message objdiff.diff.DiffTextBasicColor
766
- */
767
- declare const DiffTextBasicColor: DiffTextBasicColor$Type;
768
- declare class DiffTextLine$Type extends MessageType<DiffTextLine> {
769
- constructor();
770
- create(value?: PartialMessage<DiffTextLine>): DiffTextLine;
771
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextLine): DiffTextLine;
772
- internalBinaryWrite(message: DiffTextLine, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
773
- }
774
- /**
775
- * @generated from protobuf message objdiff.diff.DiffTextLine
776
- */
777
- interface DiffTextLine {
778
- /**
779
- * @generated from protobuf field: uint32 line_number = 1;
780
- */
781
- line_number: number;
782
- }
783
- /**
784
- * @generated MessageType for protobuf message objdiff.diff.DiffTextLine
785
- */
786
- declare const DiffTextLine: DiffTextLine$Type;
787
- declare class DiffTextAddress$Type extends MessageType<DiffTextAddress> {
788
- constructor();
789
- create(value?: PartialMessage<DiffTextAddress>): DiffTextAddress;
790
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextAddress): DiffTextAddress;
791
- internalBinaryWrite(message: DiffTextAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
792
- }
793
- /**
794
- * @generated from protobuf message objdiff.diff.DiffTextAddress
795
- */
796
- interface DiffTextAddress {
797
- /**
798
- * @generated from protobuf field: uint64 address = 1;
799
- */
800
- address: bigint;
801
- }
802
- /**
803
- * @generated MessageType for protobuf message objdiff.diff.DiffTextAddress
804
- */
805
- declare const DiffTextAddress: DiffTextAddress$Type;
806
- declare class DiffTextOpcode$Type extends MessageType<DiffTextOpcode> {
807
- constructor();
808
- create(value?: PartialMessage<DiffTextOpcode>): DiffTextOpcode;
809
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextOpcode): DiffTextOpcode;
810
- internalBinaryWrite(message: DiffTextOpcode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
811
- }
812
- /**
813
- * @generated from protobuf message objdiff.diff.DiffTextOpcode
814
- */
815
- interface DiffTextOpcode {
816
- /**
817
- * @generated from protobuf field: string mnemonic = 1;
818
- */
819
- mnemonic: string;
820
- /**
821
- * @generated from protobuf field: uint32 opcode = 2;
822
- */
823
- opcode: number;
824
- }
825
- /**
826
- * @generated MessageType for protobuf message objdiff.diff.DiffTextOpcode
827
- */
828
- declare const DiffTextOpcode: DiffTextOpcode$Type;
829
- declare class DiffTextArgument$Type extends MessageType<DiffTextArgument> {
830
- constructor();
831
- create(value?: PartialMessage<DiffTextArgument>): DiffTextArgument;
832
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextArgument): DiffTextArgument;
833
- internalBinaryWrite(message: DiffTextArgument, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
834
- }
835
- /**
836
- * @generated from protobuf message objdiff.diff.DiffTextArgument
837
- */
838
- interface DiffTextArgument {
839
- /**
840
- * @generated from protobuf field: objdiff.diff.ArgumentValue value = 1;
841
- */
842
- value?: ArgumentValue;
843
- }
844
- /**
845
- * @generated MessageType for protobuf message objdiff.diff.DiffTextArgument
846
- */
847
- declare const DiffTextArgument: DiffTextArgument$Type;
848
- declare class DiffTextBranchDest$Type extends MessageType<DiffTextBranchDest> {
849
- constructor();
850
- create(value?: PartialMessage<DiffTextBranchDest>): DiffTextBranchDest;
851
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextBranchDest): DiffTextBranchDest;
852
- internalBinaryWrite(message: DiffTextBranchDest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
853
- }
854
- /**
855
- * @generated from protobuf message objdiff.diff.DiffTextBranchDest
856
- */
857
- interface DiffTextBranchDest {
858
- /**
859
- * @generated from protobuf field: uint64 address = 1;
860
- */
861
- address: bigint;
862
- }
863
- /**
864
- * @generated MessageType for protobuf message objdiff.diff.DiffTextBranchDest
865
- */
866
- declare const DiffTextBranchDest: DiffTextBranchDest$Type;
867
- declare class DiffTextSymbol$Type extends MessageType<DiffTextSymbol> {
868
- constructor();
869
- create(value?: PartialMessage<DiffTextSymbol>): DiffTextSymbol;
870
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextSymbol): DiffTextSymbol;
871
- internalBinaryWrite(message: DiffTextSymbol, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
872
- }
873
- /**
874
- * @generated from protobuf message objdiff.diff.DiffTextSymbol
875
- */
876
- interface DiffTextSymbol {
877
- /**
878
- * @generated from protobuf field: objdiff.diff.RelocationTarget target = 1;
879
- */
880
- target?: RelocationTarget;
881
- }
882
- /**
883
- * @generated MessageType for protobuf message objdiff.diff.DiffTextSymbol
884
- */
885
- declare const DiffTextSymbol: DiffTextSymbol$Type;
886
- declare class DiffTextSpacing$Type extends MessageType<DiffTextSpacing> {
887
- constructor();
888
- create(value?: PartialMessage<DiffTextSpacing>): DiffTextSpacing;
889
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextSpacing): DiffTextSpacing;
890
- internalBinaryWrite(message: DiffTextSpacing, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
891
- }
892
- /**
893
- * @generated from protobuf message objdiff.diff.DiffTextSpacing
894
- */
895
- interface DiffTextSpacing {
896
- /**
897
- * @generated from protobuf field: uint32 count = 1;
898
- */
899
- count: number;
900
- }
901
- /**
902
- * @generated MessageType for protobuf message objdiff.diff.DiffTextSpacing
903
- */
904
- declare const DiffTextSpacing: DiffTextSpacing$Type;
905
- declare class DiffTextEol$Type extends MessageType<DiffTextEol> {
906
- constructor();
907
- create(value?: PartialMessage<DiffTextEol>): DiffTextEol;
908
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffTextEol): DiffTextEol;
909
- internalBinaryWrite(message: DiffTextEol, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
910
- }
911
- /**
912
- * @generated from protobuf message objdiff.diff.DiffTextEol
913
- */
914
- interface DiffTextEol {
915
- }
916
- /**
917
- * @generated MessageType for protobuf message objdiff.diff.DiffTextEol
918
- */
919
- declare const DiffTextEol: DiffTextEol$Type;
920
622
 
921
623
  /**
922
624
  */
@@ -927,6 +629,14 @@ declare enum ArmR9Usage {
927
629
  }
928
630
  /**
929
631
  */
632
+ declare enum ArmArchVersion {
633
+ Auto = 0,
634
+ V4T = 1,
635
+ V5TE = 2,
636
+ V6K = 3,
637
+ }
638
+ /**
639
+ */
930
640
  declare enum X86Formatter {
931
641
  Intel = 0,
932
642
  Gas = 1,
@@ -943,14 +653,6 @@ declare enum MipsAbi {
943
653
  }
944
654
  /**
945
655
  */
946
- declare enum ArmArchVersion {
947
- Auto = 0,
948
- V4T = 1,
949
- V5TE = 2,
950
- V6K = 3,
951
- }
952
- /**
953
- */
954
656
  declare enum MipsInstrCategory {
955
657
  Auto = 0,
956
658
  Cpu = 1,
@@ -1006,7 +708,58 @@ declare class DiffObjConfig$1 {
1006
708
 
1007
709
  type DiffObjConfig = Omit<Partial<DiffObjConfig$1>, 'free'>;
1008
710
 
1009
- declare function initialize(workerUrl?: string | URL): void;
711
+ declare function initialize(data?: {
712
+ workerUrl?: string | URL;
713
+ wasmUrl?: string | URL;
714
+ }): Promise<void>;
1010
715
  declare function runDiff(left: Uint8Array | undefined, right: Uint8Array | undefined, config?: DiffObjConfig): Promise<DiffResult>;
716
+ type DiffText = DiffTextBasic | DiffTextBasicColor | DiffTextAddress | DiffTextLine | DiffTextOpcode | DiffTextArgument | DiffTextSymbol | DiffTextBranchDest | DiffTextSpacing;
717
+ type DiffTextBase = {
718
+ diff_index?: number;
719
+ };
720
+ type DiffTextBasic = DiffTextBase & {
721
+ type: 'basic';
722
+ text: string;
723
+ };
724
+ type DiffTextBasicColor = DiffTextBase & {
725
+ type: 'basic_color';
726
+ text: string;
727
+ index: number;
728
+ };
729
+ type DiffTextAddress = DiffTextBase & {
730
+ type: 'address';
731
+ address: bigint;
732
+ };
733
+ type DiffTextLine = DiffTextBase & {
734
+ type: 'line';
735
+ line_number: number;
736
+ };
737
+ type DiffTextOpcode = DiffTextBase & {
738
+ type: 'opcode';
739
+ mnemonic: string;
740
+ opcode: number;
741
+ };
742
+ type DiffTextArgument = DiffTextBase & {
743
+ type: 'argument';
744
+ value: ArgumentValue;
745
+ };
746
+ type DiffTextSymbol = DiffTextBase & {
747
+ type: 'symbol';
748
+ target: RelocationTarget;
749
+ };
750
+ type DiffTextBranchDest = DiffTextBase & {
751
+ type: 'branch_dest';
752
+ address: bigint;
753
+ };
754
+ type DiffTextSpacing = DiffTextBase & {
755
+ type: 'spacing';
756
+ count: number;
757
+ };
758
+ declare function oneof<T extends {
759
+ oneofKind: string;
760
+ }>(type: T): T & {
761
+ oneofKind: string;
762
+ };
763
+ declare function displayDiff(diff: InstructionDiff, baseAddr: bigint, cb: (text: DiffText) => void): void;
1011
764
 
1012
- export { Argument, ArgumentDiff, ArgumentRelocation, ArgumentValue, ArmArchVersion, ArmR9Usage, DataDiff, DiffDisplay, DiffKind, type DiffObjConfig, DiffResult, DiffText, DiffTextAddress, DiffTextArgument, DiffTextBasic, DiffTextBasicColor, DiffTextBranchDest, DiffTextEol, DiffTextLine, DiffTextOpcode, DiffTextSpacing, DiffTextSymbol, FunctionDiff, Instruction, InstructionBranchFrom, InstructionBranchTo, InstructionDiff, MipsAbi, MipsInstrCategory, ObjectDiff, Relocation, RelocationTarget, SectionDiff, SectionKind, Symbol, SymbolFlag, X86Formatter, initialize, runDiff };
765
+ export { Argument, ArgumentDiff, ArgumentRelocation, ArgumentValue, ArmArchVersion, ArmR9Usage, DataDiff, DiffKind, type DiffObjConfig, DiffResult, type DiffText, type DiffTextAddress, type DiffTextArgument, type DiffTextBasic, type DiffTextBasicColor, type DiffTextBranchDest, type DiffTextLine, type DiffTextOpcode, type DiffTextSpacing, type DiffTextSymbol, FunctionDiff, Instruction, InstructionBranchFrom, InstructionBranchTo, InstructionDiff, MipsAbi, MipsInstrCategory, ObjectDiff, Relocation, RelocationTarget, SectionDiff, SectionKind, Symbol, SymbolFlag, X86Formatter, displayDiff, initialize, oneof, runDiff };