react-native-nobodywho 0.1.1 → 0.1.2

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/Nobodywho.podspec CHANGED
@@ -43,10 +43,10 @@ Pod::Spec.new do |s|
43
43
  s.summary = package["description"]
44
44
  s.homepage = package["homepage"]
45
45
  s.license = package["license"]
46
- s.authors = package["author"]
46
+ s.authors = package["author"] || { "NobodyWho" => "info@nobodywho.ooo" }
47
47
 
48
48
  s.platforms = { :ios => min_ios_version_supported }
49
- s.source = { :git => "https://github.com/nobodywho-ooo/nobodywho", :tag => "#{s.version}" }
49
+ s.source = { :git => "https://github.com/nobodywho-ooo/nobodywho.git", :tag => "#{s.version}" }
50
50
 
51
51
  s.source_files = "ios/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "generated/cpp/**/*.{hpp,cpp,c,h}"
52
52
  s.vendored_frameworks = framework_name
@@ -693,108 +693,76 @@ const FfiConverterTypeMessage = (() => {
693
693
 
694
694
 
695
695
 
696
- // Error type: NobodyWhoError
697
696
 
698
- // Enum: NobodyWhoError
697
+ // Flat error type: NobodyWhoError
699
698
  export enum NobodyWhoError_Tags {
700
699
  Error = "Error"
701
700
  }
702
701
  export const NobodyWhoError = (() => {
703
-
704
-
705
- type Error__interface = {
706
- tag: NobodyWhoError_Tags.Error;
707
- inner: Readonly<{message: string}>
708
- };
709
-
710
-
711
- class Error_ extends UniffiError implements Error__interface {
702
+ class Error extends UniffiError {
712
703
  /**
713
704
  * @private
714
- * This field is private and should not be used, use `tag` instead.
705
+ * This field is private and should not be used.
715
706
  */
716
- readonly [uniffiTypeNameSymbol] = "NobodyWhoError";
717
- readonly tag = NobodyWhoError_Tags.Error;
718
- readonly inner: Readonly<{message: string}>;
719
- constructor(inner: { message: string }) {
720
- super("NobodyWhoError", "Error");
721
- this.inner = Object.freeze(inner);
722
- }
723
-
724
- static new(inner: { message: string }): Error_ {
725
- return new Error_(inner);
726
- }
707
+ readonly [uniffiTypeNameSymbol]: string = "NobodyWhoError";
708
+ /**
709
+ * @private
710
+ * This field is private and should not be used.
711
+ */
712
+ readonly [variantOrdinalSymbol] = 1;
727
713
 
728
- static instanceOf(obj: any): obj is Error_ {
729
- return obj.tag === NobodyWhoError_Tags.Error;
730
- }
731
-
714
+ readonly tag = NobodyWhoError_Tags.Error;
732
715
 
733
-
734
- static hasInner(obj: any): obj is Error_ {
735
- return Error_.instanceOf(obj);
716
+ constructor(message: string) {
717
+ super("NobodyWhoError", "Error", message);
736
718
  }
737
719
 
738
- static getInner(obj: Error_): Readonly<{message: string}> {
739
- return obj.inner;
720
+ static instanceOf(e: any): e is Error {
721
+ return (
722
+ instanceOf(e) && (e as any)[variantOrdinalSymbol] === 1
723
+ );
740
724
  }
741
-
742
725
  }
743
726
 
744
- function instanceOf(obj: any): obj is NobodyWhoError {
745
- return obj[uniffiTypeNameSymbol] === "NobodyWhoError";
727
+ // Utility function which does not rely on instanceof.
728
+ function instanceOf(e: any): e is NobodyWhoError {
729
+ return (e as any)[uniffiTypeNameSymbol] === "NobodyWhoError";
746
730
  }
747
-
748
- return Object.freeze({
731
+ return {
732
+ Error,
749
733
  instanceOf,
750
- Error: Error_
751
- });
752
-
734
+ };
753
735
  })();
754
736
 
737
+ // Union type for NobodyWhoError error type.
755
738
 
756
739
 
757
740
  export type NobodyWhoError = InstanceType<
758
741
  typeof NobodyWhoError[keyof Omit<typeof NobodyWhoError, 'instanceOf'>]
759
742
  >;
760
743
 
761
- // FfiConverter for enum NobodyWhoError
762
744
  const FfiConverterTypeNobodyWhoError = (() => {
763
- const ordinalConverter = FfiConverterInt32;
745
+ const intConverter = FfiConverterInt32;
764
746
  type TypeName = NobodyWhoError;
765
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
747
+ class FfiConverter extends AbstractFfiConverterByteArray<TypeName> {
766
748
  read(from: RustBuffer): TypeName {
767
- switch (ordinalConverter.read(from)) {
768
- case 1: return new NobodyWhoError.Error({message: FfiConverterString.read(from) });
749
+ switch (intConverter.read(from)) {
750
+ case 1: return new NobodyWhoError.Error(FfiConverterString.read(from)
751
+ );
752
+
769
753
  default: throw new UniffiInternalError.UnexpectedEnumCase();
770
754
  }
771
755
  }
772
756
  write(value: TypeName, into: RustBuffer): void {
773
- switch (value.tag) {
774
- case NobodyWhoError_Tags.Error: {
775
- ordinalConverter.write(1, into);
776
- const inner = value.inner;
777
- FfiConverterString.write(inner.message, into);
778
- return;
779
- }
780
- default:
781
- // Throwing from here means that NobodyWhoError_Tags hasn't matched an ordinal.
782
- throw new UniffiInternalError.UnexpectedEnumCase();
783
- }
757
+ const obj = value as any;
758
+ const index = obj[variantOrdinalSymbol] as number;
759
+ intConverter.write(index, into);
784
760
  }
785
761
  allocationSize(value: TypeName): number {
786
- switch (value.tag) {
787
- case NobodyWhoError_Tags.Error: {
788
- const inner = value.inner;
789
- let size = ordinalConverter.allocationSize(1);
790
- size += FfiConverterString.allocationSize(inner.message);
791
- return size;
792
- }
793
- default: throw new UniffiInternalError.UnexpectedEnumCase();
794
- }
762
+ return intConverter.allocationSize(0);
795
763
  }
796
764
  }
797
- return new FFIConverter();
765
+ return new FfiConverter();
798
766
  })();
799
767
 
800
768
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nobodywho",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Run LLMs locally with offline inference — React Native bindings",
5
5
  "main": "src/wrapper.ts",
6
6
  "types": "src/wrapper.ts",