factorix 0.5.0

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.
Files changed (202) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +20 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +105 -0
  5. data/completion/_factorix.bash +202 -0
  6. data/completion/_factorix.fish +197 -0
  7. data/completion/_factorix.zsh +376 -0
  8. data/doc/factorix.1 +377 -0
  9. data/exe/factorix +20 -0
  10. data/lib/factorix/api/category.rb +69 -0
  11. data/lib/factorix/api/image.rb +35 -0
  12. data/lib/factorix/api/license.rb +71 -0
  13. data/lib/factorix/api/mod_download_api.rb +66 -0
  14. data/lib/factorix/api/mod_info.rb +166 -0
  15. data/lib/factorix/api/mod_management_api.rb +237 -0
  16. data/lib/factorix/api/mod_portal_api.rb +204 -0
  17. data/lib/factorix/api/release.rb +49 -0
  18. data/lib/factorix/api/tag.rb +95 -0
  19. data/lib/factorix/api.rb +7 -0
  20. data/lib/factorix/api_credential.rb +54 -0
  21. data/lib/factorix/application.rb +218 -0
  22. data/lib/factorix/cache/file_system.rb +307 -0
  23. data/lib/factorix/cli/commands/backup_support.rb +46 -0
  24. data/lib/factorix/cli/commands/base.rb +90 -0
  25. data/lib/factorix/cli/commands/cache/evict.rb +180 -0
  26. data/lib/factorix/cli/commands/cache/stat.rb +201 -0
  27. data/lib/factorix/cli/commands/command_wrapper.rb +71 -0
  28. data/lib/factorix/cli/commands/completion.rb +83 -0
  29. data/lib/factorix/cli/commands/confirmable.rb +53 -0
  30. data/lib/factorix/cli/commands/download_support.rb +123 -0
  31. data/lib/factorix/cli/commands/launch.rb +79 -0
  32. data/lib/factorix/cli/commands/man.rb +29 -0
  33. data/lib/factorix/cli/commands/mod/check.rb +99 -0
  34. data/lib/factorix/cli/commands/mod/disable.rb +188 -0
  35. data/lib/factorix/cli/commands/mod/download.rb +291 -0
  36. data/lib/factorix/cli/commands/mod/edit.rb +114 -0
  37. data/lib/factorix/cli/commands/mod/enable.rb +216 -0
  38. data/lib/factorix/cli/commands/mod/image/add.rb +47 -0
  39. data/lib/factorix/cli/commands/mod/image/edit.rb +41 -0
  40. data/lib/factorix/cli/commands/mod/image/list.rb +74 -0
  41. data/lib/factorix/cli/commands/mod/install.rb +443 -0
  42. data/lib/factorix/cli/commands/mod/list.rb +372 -0
  43. data/lib/factorix/cli/commands/mod/search.rb +134 -0
  44. data/lib/factorix/cli/commands/mod/settings/dump.rb +88 -0
  45. data/lib/factorix/cli/commands/mod/settings/restore.rb +101 -0
  46. data/lib/factorix/cli/commands/mod/show.rb +202 -0
  47. data/lib/factorix/cli/commands/mod/sync.rb +299 -0
  48. data/lib/factorix/cli/commands/mod/uninstall.rb +325 -0
  49. data/lib/factorix/cli/commands/mod/update.rb +222 -0
  50. data/lib/factorix/cli/commands/mod/upload.rb +90 -0
  51. data/lib/factorix/cli/commands/path.rb +79 -0
  52. data/lib/factorix/cli/commands/requires_game_stopped.rb +32 -0
  53. data/lib/factorix/cli/commands/version.rb +25 -0
  54. data/lib/factorix/cli.rb +42 -0
  55. data/lib/factorix/dependency/edge.rb +89 -0
  56. data/lib/factorix/dependency/entry.rb +124 -0
  57. data/lib/factorix/dependency/graph/builder.rb +108 -0
  58. data/lib/factorix/dependency/graph.rb +210 -0
  59. data/lib/factorix/dependency/list.rb +244 -0
  60. data/lib/factorix/dependency/mod_version_requirement.rb +73 -0
  61. data/lib/factorix/dependency/node.rb +60 -0
  62. data/lib/factorix/dependency/parser.rb +148 -0
  63. data/lib/factorix/dependency/validation_result.rb +138 -0
  64. data/lib/factorix/dependency/validator.rb +190 -0
  65. data/lib/factorix/errors.rb +112 -0
  66. data/lib/factorix/formatting.rb +56 -0
  67. data/lib/factorix/game_version.rb +98 -0
  68. data/lib/factorix/http/cache_decorator.rb +106 -0
  69. data/lib/factorix/http/cached_response.rb +37 -0
  70. data/lib/factorix/http/client.rb +187 -0
  71. data/lib/factorix/http/response.rb +31 -0
  72. data/lib/factorix/http/retry_decorator.rb +59 -0
  73. data/lib/factorix/http/retry_strategy.rb +80 -0
  74. data/lib/factorix/info_json.rb +90 -0
  75. data/lib/factorix/installed_mod.rb +239 -0
  76. data/lib/factorix/mod.rb +55 -0
  77. data/lib/factorix/mod_list.rb +174 -0
  78. data/lib/factorix/mod_settings.rb +278 -0
  79. data/lib/factorix/mod_state.rb +34 -0
  80. data/lib/factorix/mod_version.rb +99 -0
  81. data/lib/factorix/portal.rb +185 -0
  82. data/lib/factorix/progress/download_handler.rb +46 -0
  83. data/lib/factorix/progress/multi_presenter.rb +45 -0
  84. data/lib/factorix/progress/presenter.rb +67 -0
  85. data/lib/factorix/progress/presenter_adapter.rb +46 -0
  86. data/lib/factorix/progress/scan_handler.rb +33 -0
  87. data/lib/factorix/progress/upload_handler.rb +33 -0
  88. data/lib/factorix/runtime/base.rb +233 -0
  89. data/lib/factorix/runtime/linux.rb +32 -0
  90. data/lib/factorix/runtime/mac_os.rb +53 -0
  91. data/lib/factorix/runtime/user_configurable.rb +69 -0
  92. data/lib/factorix/runtime/windows.rb +85 -0
  93. data/lib/factorix/runtime/wsl.rb +118 -0
  94. data/lib/factorix/runtime.rb +32 -0
  95. data/lib/factorix/save_file.rb +178 -0
  96. data/lib/factorix/ser_des/deserializer.rb +198 -0
  97. data/lib/factorix/ser_des/serializer.rb +231 -0
  98. data/lib/factorix/ser_des/signed_integer.rb +63 -0
  99. data/lib/factorix/ser_des/unsigned_integer.rb +65 -0
  100. data/lib/factorix/service_credential.rb +127 -0
  101. data/lib/factorix/transfer/downloader.rb +162 -0
  102. data/lib/factorix/transfer/uploader.rb +232 -0
  103. data/lib/factorix/version.rb +6 -0
  104. data/lib/factorix.rb +38 -0
  105. data/sig/dry/auto_inject.rbs +15 -0
  106. data/sig/dry/cli.rbs +19 -0
  107. data/sig/dry/configurable.rbs +13 -0
  108. data/sig/dry/core/container.rbs +17 -0
  109. data/sig/dry/events/publisher.rbs +22 -0
  110. data/sig/dry/logger.rbs +16 -0
  111. data/sig/factorix/api/category.rbs +15 -0
  112. data/sig/factorix/api/image.rbs +15 -0
  113. data/sig/factorix/api/license.rbs +20 -0
  114. data/sig/factorix/api/mod_download_api.rbs +18 -0
  115. data/sig/factorix/api/mod_info.rbs +67 -0
  116. data/sig/factorix/api/mod_management_api.rbs +25 -0
  117. data/sig/factorix/api/mod_portal_api.rbs +31 -0
  118. data/sig/factorix/api/release.rbs +27 -0
  119. data/sig/factorix/api/tag.rbs +15 -0
  120. data/sig/factorix/api.rbs +8 -0
  121. data/sig/factorix/api_credential.rbs +17 -0
  122. data/sig/factorix/application.rbs +86 -0
  123. data/sig/factorix/cache/file_system.rbs +35 -0
  124. data/sig/factorix/cli/commands/base.rbs +13 -0
  125. data/sig/factorix/cli/commands/cache/evict.rbs +17 -0
  126. data/sig/factorix/cli/commands/cache/stat.rbs +17 -0
  127. data/sig/factorix/cli/commands/command_wrapper.rbs +13 -0
  128. data/sig/factorix/cli/commands/completion/zsh.rbs +15 -0
  129. data/sig/factorix/cli/commands/confirmable.rbs +12 -0
  130. data/sig/factorix/cli/commands/download_support.rbs +12 -0
  131. data/sig/factorix/cli/commands/launch.rbs +15 -0
  132. data/sig/factorix/cli/commands/mod/check.rbs +18 -0
  133. data/sig/factorix/cli/commands/mod/disable.rbs +20 -0
  134. data/sig/factorix/cli/commands/mod/download.rbs +18 -0
  135. data/sig/factorix/cli/commands/mod/edit.rbs +30 -0
  136. data/sig/factorix/cli/commands/mod/enable.rbs +20 -0
  137. data/sig/factorix/cli/commands/mod/image/add.rbs +19 -0
  138. data/sig/factorix/cli/commands/mod/image/edit.rbs +19 -0
  139. data/sig/factorix/cli/commands/mod/image/list.rbs +19 -0
  140. data/sig/factorix/cli/commands/mod/install.rbs +19 -0
  141. data/sig/factorix/cli/commands/mod/list.rbs +30 -0
  142. data/sig/factorix/cli/commands/mod/search.rbs +18 -0
  143. data/sig/factorix/cli/commands/mod/settings/dump.rbs +17 -0
  144. data/sig/factorix/cli/commands/mod/settings/restore.rbs +17 -0
  145. data/sig/factorix/cli/commands/mod/sync.rbs +19 -0
  146. data/sig/factorix/cli/commands/mod/uninstall.rbs +20 -0
  147. data/sig/factorix/cli/commands/mod/update.rbs +19 -0
  148. data/sig/factorix/cli/commands/mod/upload.rbs +24 -0
  149. data/sig/factorix/cli/commands/path.rbs +18 -0
  150. data/sig/factorix/cli/commands/requires_game_stopped.rbs +13 -0
  151. data/sig/factorix/cli/commands/version.rbs +13 -0
  152. data/sig/factorix/cli.rbs +11 -0
  153. data/sig/factorix/dependency/edge.rbs +32 -0
  154. data/sig/factorix/dependency/entry.rbs +30 -0
  155. data/sig/factorix/dependency/graph/builder.rbs +17 -0
  156. data/sig/factorix/dependency/graph.rbs +39 -0
  157. data/sig/factorix/dependency/list.rbs +69 -0
  158. data/sig/factorix/dependency/mod_version_requirement.rbs +18 -0
  159. data/sig/factorix/dependency/node.rbs +24 -0
  160. data/sig/factorix/dependency/parser.rbs +11 -0
  161. data/sig/factorix/dependency/validation_result.rbs +56 -0
  162. data/sig/factorix/dependency/validator.rbs +13 -0
  163. data/sig/factorix/errors.rbs +132 -0
  164. data/sig/factorix/formatting.rbs +8 -0
  165. data/sig/factorix/game_version.rbs +24 -0
  166. data/sig/factorix/http/cache_decorator.rbs +64 -0
  167. data/sig/factorix/http/client.rbs +55 -0
  168. data/sig/factorix/http/response.rbs +28 -0
  169. data/sig/factorix/http/retry_decorator.rbs +44 -0
  170. data/sig/factorix/http/retry_strategy.rbs +42 -0
  171. data/sig/factorix/info_json.rbs +19 -0
  172. data/sig/factorix/installed_mod.rbs +34 -0
  173. data/sig/factorix/mod.rbs +20 -0
  174. data/sig/factorix/mod_list.rbs +44 -0
  175. data/sig/factorix/mod_settings.rbs +47 -0
  176. data/sig/factorix/mod_state.rbs +18 -0
  177. data/sig/factorix/mod_version.rbs +23 -0
  178. data/sig/factorix/portal.rbs +37 -0
  179. data/sig/factorix/progress/download_handler.rbs +19 -0
  180. data/sig/factorix/progress/multi_presenter.rbs +15 -0
  181. data/sig/factorix/progress/presenter.rbs +17 -0
  182. data/sig/factorix/progress/presenter_adapter.rbs +17 -0
  183. data/sig/factorix/progress/scan_handler.rbs +16 -0
  184. data/sig/factorix/progress/upload_handler.rbs +17 -0
  185. data/sig/factorix/runtime/base.rbs +45 -0
  186. data/sig/factorix/runtime/linux.rbs +15 -0
  187. data/sig/factorix/runtime/mac_os.rbs +15 -0
  188. data/sig/factorix/runtime/user_configurable.rbs +13 -0
  189. data/sig/factorix/runtime/windows.rbs +23 -0
  190. data/sig/factorix/runtime/wsl.rbs +19 -0
  191. data/sig/factorix/runtime.rbs +9 -0
  192. data/sig/factorix/save_file.rbs +40 -0
  193. data/sig/factorix/ser_des/deserializer.rbs +49 -0
  194. data/sig/factorix/ser_des/serializer.rbs +45 -0
  195. data/sig/factorix/ser_des/signed_integer.rbs +37 -0
  196. data/sig/factorix/ser_des/unsigned_integer.rbs +37 -0
  197. data/sig/factorix/service_credential.rbs +19 -0
  198. data/sig/factorix/transfer/downloader.rbs +15 -0
  199. data/sig/factorix/transfer/uploader.rbs +21 -0
  200. data/sig/factorix.rbs +9 -0
  201. data/sig/tty/progressbar.rbs +18 -0
  202. metadata +431 -0
@@ -0,0 +1,42 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module HTTP
7
+ # Class that manages retry strategy with exponential backoff and randomization
8
+ class RetryStrategy
9
+ attr_reader logger: Dry::Logger::Dispatcher
10
+
11
+ type retry_callback = ^(StandardError exception, Integer try, Float elapsed_time, Float next_interval) -> void
12
+
13
+ type retry_options = {
14
+ tries: Integer,
15
+ base_interval: Float,
16
+ multiplier: Float,
17
+ rand_factor: Float,
18
+ on: Array[Class],
19
+ on_retry: retry_callback
20
+ }
21
+
22
+ # Initialize a new retry strategy with customizable options
23
+ #
24
+ # @param options [Hash] Options for retry behavior
25
+ # @option options [Integer] :tries Number of attempts (including the initial try)
26
+ # @option options [Float] :base_interval Initial interval between retries (seconds)
27
+ # @option options [Float] :multiplier Exponential backoff multiplier
28
+ # @option options [Float] :rand_factor Randomization factor
29
+ # @option options [Array<Class>] :on Exception classes to retry on
30
+ # @option options [Proc] :on_retry Callback called on each retry
31
+ def initialize: (?logger: Dry::Logger::Dispatcher?, **untyped options) -> void
32
+
33
+ # Execute the block with automatic retry on specified exceptions.
34
+ # Uses exponential backoff with randomization for retry intervals
35
+ #
36
+ # @yield Block to execute
37
+ # @return [Object] Return value of the block
38
+ # @raise [StandardError] If the block fails after all retries
39
+ def with_retry: [T] () { () -> T } -> T
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,19 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class InfoJSON < Data
7
+ attr_reader name: String
8
+ attr_reader version: MODVersion
9
+ attr_reader title: String
10
+ attr_reader author: String
11
+ attr_reader description: String
12
+ attr_reader factorio_version: String?
13
+ attr_reader dependencies: Array[Factorix::Dependency::Entry]
14
+
15
+ def self.from_json: (String json_string) -> InfoJSON
16
+ def self.from_hash: (Hash[String, untyped] data) -> InfoJSON
17
+ def self.from_zip: (Pathname | String zip_path) -> InfoJSON
18
+ end
19
+ end
@@ -0,0 +1,34 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class InstalledMOD
7
+ include Comparable
8
+
9
+ ZIP_FORM: Symbol
10
+
11
+ DIRECTORY_FORM: Symbol
12
+
13
+ def self.from_zip: (Pathname path) -> InstalledMOD
14
+
15
+ def self.from_directory: (Pathname path) -> InstalledMOD
16
+
17
+ # Enumerable class methods
18
+ def self.all: () -> Array[InstalledMOD]
19
+ def self.each: () { (InstalledMOD) -> void } -> Array[InstalledMOD]
20
+ | () -> Enumerator[InstalledMOD, Array[InstalledMOD]]
21
+
22
+ attr_reader mod: MOD
23
+ attr_reader version: MODVersion
24
+ attr_reader form: Symbol
25
+ attr_reader path: Pathname
26
+ attr_reader info: InfoJSON
27
+
28
+ def <=>: (InstalledMOD other) -> Integer?
29
+
30
+ def base?: () -> bool
31
+
32
+ def expansion?: () -> bool
33
+ end
34
+ end
@@ -0,0 +1,20 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ # Represents a local MOD
7
+ class MOD < Data
8
+ include Comparable
9
+
10
+ attr_reader name: String
11
+
12
+ def base?: () -> bool
13
+
14
+ def expansion?: () -> bool
15
+
16
+ def to_s: () -> String
17
+
18
+ def <=>: (untyped other) -> Integer?
19
+ end
20
+ end
@@ -0,0 +1,44 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ # Represents a list of MODs and their enabled status
7
+ class MODList
8
+ include Enumerable[[MOD, MODState]]
9
+
10
+ # Raised when a MOD is not found in the list
11
+ class MODNotInListError < Factorix::MODNotFoundError
12
+ end
13
+
14
+ @mods: Hash[MOD, MODState]
15
+
16
+ def self.load: (?Pathname path) -> MODList
17
+
18
+ def initialize: (?Hash[MOD, MODState] mods) -> void
19
+
20
+ def save: (?Pathname path) -> void
21
+
22
+ def each: () -> Enumerator[[MOD, MODState], self]
23
+ | () { ([MOD, MODState]) -> void } -> self
24
+
25
+ def each_mod: () -> Enumerator[MOD, self]
26
+ | () { (MOD) -> void } -> self
27
+
28
+ alias each_key each_mod
29
+
30
+ def add: (MOD mod, ?enabled: bool, ?version: MODVersion?) -> void
31
+
32
+ def remove: (MOD mod) -> void
33
+
34
+ def exist?: (MOD mod) -> bool
35
+
36
+ def enabled?: (MOD mod) -> bool
37
+
38
+ def version: (MOD mod) -> MODVersion?
39
+
40
+ def enable: (MOD mod) -> void
41
+
42
+ def disable: (MOD mod) -> void
43
+ end
44
+ end
@@ -0,0 +1,47 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class MODSettings
7
+ VALID_SECTIONS: Array[String]
8
+
9
+ class Section
10
+ include Enumerable[[ String, untyped ]]
11
+
12
+ @name: String
13
+ @settings: Hash[String, untyped]
14
+
15
+ def initialize: (String name) -> void
16
+ def name: () -> String
17
+ def []=: (String key, untyped value) -> untyped
18
+ def []: (String key) -> untyped
19
+ def each: () -> Enumerator[[String, untyped], self]
20
+ | () { ([String, untyped]) -> void } -> self
21
+ def empty?: () -> bool
22
+ def key?: (String key) -> bool
23
+ def has_key?: (String key) -> bool
24
+ def include?: (String key) -> bool
25
+ def keys: () -> Array[String]
26
+ def values: () -> Array[untyped]
27
+ def size: () -> Integer
28
+ def length: () -> Integer
29
+ def fetch: (String key) -> untyped
30
+ | (String key, untyped default) -> untyped
31
+ | (String key) { (String) -> untyped } -> untyped
32
+ def to_h: () -> Hash[String, untyped]
33
+ end
34
+
35
+ @sections: Hash[String, Section]
36
+ @game_version: GameVersion
37
+
38
+ def self.load: (?Pathname path) -> MODSettings
39
+
40
+ def initialize: (GameVersion game_version, Hash[String, Section] sections) -> void
41
+ def game_version: () -> GameVersion
42
+ def []: (String name) -> Section
43
+ def each_section: () -> Enumerator[Section, self]
44
+ | () { (Section) -> void } -> self
45
+ def save: (?Pathname path) -> void
46
+ end
47
+ end
@@ -0,0 +1,18 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ # Represents the state of a MOD in a MOD list
7
+ class MODState < Data
8
+ attr_reader enabled: bool
9
+
10
+ attr_reader version: MODVersion?
11
+
12
+ def initialize: (enabled: bool, ?version: MODVersion?) -> void
13
+
14
+ def self.[]: (enabled: bool, ?version: MODVersion?) -> MODState
15
+
16
+ def enabled?: () -> bool
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class MODVersion
7
+ include Comparable
8
+
9
+ attr_reader major: Integer
10
+ attr_reader minor: Integer
11
+ attr_reader patch: Integer
12
+
13
+ def self.from_string: (String str) -> MODVersion
14
+
15
+ def self.from_numbers: (Integer major, Integer minor, Integer patch) -> MODVersion
16
+
17
+ def to_s: () -> String
18
+
19
+ def to_a: () -> Array[Integer]
20
+
21
+ def <=>: (MODVersion other) -> Integer?
22
+ end
23
+ end
@@ -0,0 +1,37 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Portal
7
+ def list_mods: (
8
+ *String namelist,
9
+ ?hide_deprecated: bool?,
10
+ ?page: Integer?,
11
+ ?page_size: (Integer | String)?,
12
+ ?sort: ("name" | "created_at" | "updated_at")?,
13
+ ?sort_order: ("asc" | "desc")?,
14
+ ?version: ("0.13" | "0.14" | "0.15" | "0.16" | "0.17" | "0.18" | "1.0" | "1.1" | "2.0")?
15
+ ) -> Array[API::MODInfo]
16
+
17
+ def get_mod: (String name) -> API::MODInfo
18
+
19
+ def get_mod_full: (String name) -> API::MODInfo
20
+
21
+ def download_mod: (API::Release release, Pathname output) -> void
22
+
23
+ def upload_mod: (String mod_name, Pathname file_path, **untyped metadata) -> void
24
+
25
+ def edit_mod: (String mod_name, **untyped metadata) -> void
26
+
27
+ def add_mod_image: (String mod_name, Pathname image_file) -> API::Image
28
+
29
+ def edit_mod_images: (String mod_name, Array[String] image_ids) -> void
30
+
31
+ attr_reader mod_portal_api: API::MODPortalAPI
32
+
33
+ attr_reader mod_download_api: API::MODDownloadAPI
34
+
35
+ attr_reader mod_management_api: API::MODManagementAPI
36
+ end
37
+ end
@@ -0,0 +1,19 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Progress
7
+ class DownloadHandler
8
+ def initialize: (Presenter | PresenterAdapter presenter) -> void
9
+
10
+ def on_download_started: (Hash[Symbol, untyped] event) -> void
11
+
12
+ def on_download_progress: (Hash[Symbol, untyped] event) -> void
13
+
14
+ def on_download_completed: (Hash[Symbol, untyped] event) -> void
15
+
16
+ def on_cache_hit: (Hash[Symbol, untyped] event) -> void
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Progress
7
+ class MultiPresenter
8
+ def initialize: (?title: String, ?output: IO) -> void
9
+
10
+ def register: ((String | Symbol) name, title: String) -> PresenterAdapter
11
+
12
+ def []: ((String | Symbol) name) -> PresenterAdapter?
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Progress
7
+ class Presenter
8
+ def initialize: (?title: String, ?output: IO) -> void
9
+
10
+ def start: (total: Integer, ?format: String?) -> void
11
+
12
+ def update: (Integer current) -> void
13
+
14
+ def finish: () -> void
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Progress
7
+ class PresenterAdapter
8
+ def initialize: (TTY::ProgressBar tty_bar, Mutex mutex) -> void
9
+
10
+ def start: (total: Integer, ?format: String?) -> void
11
+
12
+ def update: (Integer current) -> void
13
+
14
+ def finish: () -> void
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Progress
7
+ class ScanHandler
8
+ @presenter: Presenter | PresenterAdapter
9
+
10
+ def initialize: (Presenter | PresenterAdapter presenter) -> void
11
+ def on_scan_started: (Hash[Symbol, untyped] event) -> void
12
+ def on_scan_progress: (Hash[Symbol, untyped] event) -> void
13
+ def on_scan_completed: (Hash[Symbol, untyped] event) -> void
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Progress
7
+ class UploadHandler
8
+ def initialize: (Presenter | PresenterAdapter presenter) -> void
9
+
10
+ def on_upload_started: (Hash[Symbol, untyped] event) -> void
11
+
12
+ def on_upload_progress: (Hash[Symbol, untyped] event) -> void
13
+
14
+ def on_upload_completed: (Hash[Symbol, untyped] event) -> void
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,45 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ class Base
8
+ def executable_path: () -> Pathname
9
+
10
+ def user_dir: () -> Pathname
11
+
12
+ def mods_dir: () -> Pathname
13
+
14
+ def mod_list_path: () -> Pathname
15
+
16
+ def mod_settings_path: () -> Pathname
17
+
18
+ def player_data_path: () -> Pathname
19
+
20
+ def xdg_cache_home_dir: () -> Pathname
21
+
22
+ def xdg_config_home_dir: () -> Pathname
23
+
24
+ def xdg_data_home_dir: () -> Pathname
25
+
26
+ def xdg_state_home_dir: () -> Pathname
27
+
28
+ def factorix_cache_dir: () -> Pathname
29
+
30
+ def factorix_config_path: () -> Pathname
31
+
32
+ def factorix_log_path: () -> Pathname
33
+
34
+ def lock_path: () -> Pathname
35
+
36
+ def current_log_path: () -> Pathname
37
+
38
+ def previous_log_path: () -> Pathname
39
+
40
+ def running?: () -> bool
41
+
42
+ def launch: (*String, async: bool) -> void
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,15 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ class Linux < Base
8
+ def executable_path: () -> Pathname
9
+
10
+ def user_dir: () -> Pathname
11
+
12
+ def data_dir: () -> Pathname
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ class MacOS < Base
8
+ def executable_path: () -> Pathname
9
+
10
+ def user_dir: () -> Pathname
11
+
12
+ def data_dir: () -> Pathname
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ module UserConfigurable
8
+ def executable_path: () -> Pathname
9
+
10
+ def user_dir: () -> Pathname
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,23 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ class Windows < Base
8
+ def initialize: (?path: WindowsPath) -> void
9
+
10
+ def executable_path: () -> Pathname
11
+
12
+ def user_dir: () -> Pathname
13
+
14
+ class WindowsPath
15
+ def program_files_x86: () -> Pathname
16
+
17
+ def app_data: () -> Pathname
18
+
19
+ def local_app_data: () -> Pathname
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ class WSL < Windows
8
+ def initialize: (?path: WSLPath) -> void
9
+
10
+ class WSLPath
11
+ def program_files_x86: () -> Pathname
12
+
13
+ def app_data: () -> Pathname
14
+
15
+ def local_app_data: () -> Pathname
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Runtime
7
+ def self.detect: () -> Base
8
+ end
9
+ end
@@ -0,0 +1,40 @@
1
+ module Factorix
2
+ class SaveFile
3
+ attr_reader version: GameVersion
4
+ attr_reader mods: Hash[String, MODState]
5
+ attr_reader startup_settings: MODSettings::Section
6
+
7
+ def initialize: (version: GameVersion, mods: Hash[String, MODState], startup_settings: MODSettings::Section) -> void
8
+
9
+ LEVEL_FILE_NAMES: Array[String]
10
+
11
+ def self.load: (Pathname path) -> SaveFile
12
+
13
+ class Parser
14
+ @path: Pathname
15
+ @version: GameVersion
16
+ @mods: Hash[String, MODState]
17
+ @startup_settings: MODSettings::Section
18
+
19
+ def initialize: (Pathname path) -> void
20
+
21
+ def parse: () -> SaveFile
22
+
23
+ private
24
+
25
+ def open_level_file: () { (IO) -> untyped } -> untyped
26
+
27
+ def find_level_entry: (Zip::File zip_file, String file_name) -> Zip::Entry?
28
+
29
+ def decompress_if_needed: (IO stream) -> IO
30
+
31
+ def parse_save_header: (SerDes::Deserializer deserializer) -> void
32
+
33
+ def parse_mods: (SerDes::Deserializer deserializer) -> void
34
+
35
+ def skip_unknown_bytes: (SerDes::Deserializer deserializer) -> void
36
+
37
+ def parse_startup_settings: (SerDes::Deserializer deserializer) -> void
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,49 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module SerDes
7
+ class Deserializer
8
+ def initialize: (untyped stream) -> void
9
+
10
+ def read_bytes: (Integer length) -> String
11
+
12
+ def read_u8: () -> Integer
13
+
14
+ def read_u16: () -> Integer
15
+
16
+ def read_u32: () -> Integer
17
+
18
+ def read_optim_u16: () -> Integer
19
+
20
+ def read_optim_u32: () -> Integer
21
+
22
+ def read_u16_tuple: (Integer length) -> Array[Integer]
23
+
24
+ def read_bool: () -> bool
25
+
26
+ def read_str: () -> String
27
+
28
+ def read_str_property: () -> String
29
+
30
+ def read_double: () -> Float
31
+
32
+ def read_game_version: () -> GameVersion
33
+
34
+ def read_mod_version: () -> MODVersion
35
+
36
+ def read_long: () -> Integer
37
+
38
+ def read_unsigned_long: () -> Integer
39
+
40
+ def read_dictionary: () -> Hash[String, untyped]
41
+
42
+ def read_list: () -> Hash[String, untyped]
43
+
44
+ def read_property_tree: () -> (nil | bool | Float | String | Array[untyped] | Hash[String, untyped] | Integer)
45
+
46
+ def eof?: () -> bool
47
+ end
48
+ end
49
+ end