Skip to content

Commit

Permalink
💫 Update: RNIComputableSizeMode
Browse files Browse the repository at this point in the history
Summary: Make public.
  • Loading branch information
dominicstop committed May 19, 2023
1 parent 79a05f4 commit f96c970
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public struct RNIComputableOffset {
public var offset: Double;
public var offsetOperation: OffsetOperation;

func compute(withValue value: Double) -> Double {
public func compute(withValue value: Double) -> Double {
return self.offsetOperation.compute(a: self.offset, b: value);
};
};

extension RNIComputableOffset {

init?(fromDict dict: NSDictionary){
public init?(fromDict dict: NSDictionary){
guard let offset = dict["offset"] as? NSNumber else { return nil };
self.offset = offset.doubleValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import JavaScriptCore


public struct RNIComputableSize {
let mode: RNIComputableSizeMode;
public let mode: RNIComputableSizeMode;

let offsetWidth: RNIComputableOffset?;
let offsetHeight: RNIComputableOffset?;
public let offsetWidth: RNIComputableOffset?;
public let offsetHeight: RNIComputableOffset?;

func computeOffsets(withSize size: CGSize) -> CGSize {
public func computeOffsets(withSize size: CGSize) -> CGSize {
let offsetWidth =
self.offsetWidth?.compute(withValue: size.width);

Expand All @@ -28,7 +28,7 @@ public struct RNIComputableSize {
);
};

func compute(
public func compute(
withTargetSize targetSize: CGSize,
currentSize: CGSize
) -> CGSize {
Expand All @@ -50,7 +50,7 @@ public struct RNIComputableSize {
};
};

func computeWithOffsets(
public func computeWithOffsets(
withTargetSize targetSize: CGSize,
currentSize: CGSize
) -> CGSize {
Expand All @@ -64,7 +64,7 @@ public struct RNIComputableSize {
};

extension RNIComputableSize {
init?(fromDict dict: NSDictionary){
public init?(fromDict dict: NSDictionary){
guard let mode = RNIComputableSizeMode(fromDict: dict)
else { return nil };

Expand All @@ -87,7 +87,7 @@ extension RNIComputableSize {
}();
};

init(mode: RNIComputableSizeMode){
public init(mode: RNIComputableSizeMode){
self.mode = mode;
self.offsetWidth = nil;
self.offsetHeight = nil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum RNIComputableSizeMode {
};

extension RNIComputableSizeMode {
init?(fromDict dict: NSDictionary){
public init?(fromDict dict: NSDictionary){
guard let mode = dict["mode"] as? String else { return nil };

switch mode {
Expand Down

0 comments on commit f96c970

Please sign in to comment.