@satisfactory-dev/docs.json.ts 0.6.1

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 (152) hide show
  1. package/LICENSE.md +190 -0
  2. package/README.md +81 -0
  3. package/assert/CustomAssert.d.ts +2 -0
  4. package/assert/CustomAssert.js +5 -0
  5. package/lib/AjvUtilities.d.ts +7 -0
  6. package/lib/AjvUtilities.js +59 -0
  7. package/lib/ArrayUtilities.d.ts +24 -0
  8. package/lib/ArrayUtilities.js +21 -0
  9. package/lib/CustomParsingTypes/CustomPairingTypes.d.ts +37 -0
  10. package/lib/CustomParsingTypes/CustomPairingTypes.js +42 -0
  11. package/lib/CustomParsingTypes/TypedString.d.ts +411 -0
  12. package/lib/CustomParsingTypes/TypedString.js +204 -0
  13. package/lib/CustomParsingTypes/TypedStringConst.d.ts +28 -0
  14. package/lib/CustomParsingTypes/TypedStringConst.js +35 -0
  15. package/lib/CustomParsingTypes/TypedStringEnum.d.ts +30 -0
  16. package/lib/CustomParsingTypes/TypedStringEnum.js +36 -0
  17. package/lib/CustomParsingTypes/TypedStringPattern.d.ts +64 -0
  18. package/lib/CustomParsingTypes/TypedStringPattern.js +82 -0
  19. package/lib/CustomParsingTypes/UnrealEngineString.d.ts +215 -0
  20. package/lib/CustomParsingTypes/UnrealEngineString.js +308 -0
  21. package/lib/CustomParsingTypes/ValueToRegexFormatter.d.ts +29 -0
  22. package/lib/CustomParsingTypes/ValueToRegexFormatter.js +205 -0
  23. package/lib/DataDiscovery/CustomTypes/BooleanOrBooleanExtended.d.ts +12 -0
  24. package/lib/DataDiscovery/CustomTypes/BooleanOrBooleanExtended.js +32 -0
  25. package/lib/DataDiscovery/CustomTypes/StringStartsWith.d.ts +9 -0
  26. package/lib/DataDiscovery/CustomTypes/StringStartsWith.js +19 -0
  27. package/lib/DataDiscovery/CustomTypes/TypedString.d.ts +23 -0
  28. package/lib/DataDiscovery/CustomTypes/TypedString.js +251 -0
  29. package/lib/DataDiscovery/CustomTypes/UnrealEngineString.d.ts +9 -0
  30. package/lib/DataDiscovery/CustomTypes/UnrealEngineString.js +45 -0
  31. package/lib/DataDiscovery/Generator.d.ts +19 -0
  32. package/lib/DataDiscovery/Generator.js +41 -0
  33. package/lib/DataDiscovery/JsonSchema/Array.d.ts +17 -0
  34. package/lib/DataDiscovery/JsonSchema/Array.js +41 -0
  35. package/lib/DataDiscovery/JsonSchema/Object.d.ts +61 -0
  36. package/lib/DataDiscovery/JsonSchema/Object.js +184 -0
  37. package/lib/DataDiscovery/JsonSchema/OneOf.d.ts +13 -0
  38. package/lib/DataDiscovery/JsonSchema/OneOf.js +47 -0
  39. package/lib/DataDiscovery/JsonSchema/Ref.d.ts +17 -0
  40. package/lib/DataDiscovery/JsonSchema/Ref.js +66 -0
  41. package/lib/DataDiscovery/JsonSchema/StringType.d.ts +39 -0
  42. package/lib/DataDiscovery/JsonSchema/StringType.js +121 -0
  43. package/lib/DataDiscovery/Literal.d.ts +8 -0
  44. package/lib/DataDiscovery/Literal.js +69 -0
  45. package/lib/DataDiscovery.d.ts +28 -0
  46. package/lib/DataDiscovery.js +116 -0
  47. package/lib/DocsToAutoImport/ArrayTypeNodes.d.ts +5 -0
  48. package/lib/DocsToAutoImport/ArrayTypeNodes.js +7 -0
  49. package/lib/DocsToAutoImport/ClassDeclarations.d.ts +5 -0
  50. package/lib/DocsToAutoImport/ClassDeclarations.js +14 -0
  51. package/lib/DocsToAutoImport/FunctionDeclaration.d.ts +5 -0
  52. package/lib/DocsToAutoImport/FunctionDeclaration.js +16 -0
  53. package/lib/DocsToAutoImport/LiteralTypeNodes.d.ts +5 -0
  54. package/lib/DocsToAutoImport/LiteralTypeNodes.js +23 -0
  55. package/lib/DocsToAutoImport/MethodDeclarations.d.ts +5 -0
  56. package/lib/DocsToAutoImport/MethodDeclarations.js +15 -0
  57. package/lib/DocsToAutoImport/NodeExtraction.d.ts +6 -0
  58. package/lib/DocsToAutoImport/NodeExtraction.js +21 -0
  59. package/lib/DocsToAutoImport/PropertyDeclarations.d.ts +5 -0
  60. package/lib/DocsToAutoImport/PropertyDeclarations.js +10 -0
  61. package/lib/DocsToAutoImport/TupleTypeNodes.d.ts +5 -0
  62. package/lib/DocsToAutoImport/TupleTypeNodes.js +7 -0
  63. package/lib/DocsToAutoImport/TypeLiteralNodes.d.ts +5 -0
  64. package/lib/DocsToAutoImport/TypeLiteralNodes.js +33 -0
  65. package/lib/DocsToAutoImport/TypeReferenceNodes.d.ts +5 -0
  66. package/lib/DocsToAutoImport/TypeReferenceNodes.js +7 -0
  67. package/lib/DocsToAutoImport/from_Node_array.d.ts +3 -0
  68. package/lib/DocsToAutoImport/from_Node_array.js +245 -0
  69. package/lib/DocsTsAutoImports.d.ts +21 -0
  70. package/lib/DocsTsAutoImports.js +110 -0
  71. package/lib/DocsTsGenerator/FilesGenerator.d.ts +25 -0
  72. package/lib/DocsTsGenerator/FilesGenerator.js +52 -0
  73. package/lib/DocsTsGenerator.d.ts +47 -0
  74. package/lib/DocsTsGenerator.js +188 -0
  75. package/lib/DocsValidation.d.ts +7 -0
  76. package/lib/DocsValidation.js +179 -0
  77. package/lib/Exceptions.d.ts +7 -0
  78. package/lib/Exceptions.js +13 -0
  79. package/lib/FilesGenerator.d.ts +19 -0
  80. package/lib/FilesGenerator.js +38 -0
  81. package/lib/MarkdownUtilities.d.ts +16 -0
  82. package/lib/MarkdownUtilities.js +68 -0
  83. package/lib/StringStartsWith.d.ts +10 -0
  84. package/lib/StringStartsWith.js +20 -0
  85. package/lib/TsFactoryWrapper.d.ts +80 -0
  86. package/lib/TsFactoryWrapper.js +236 -0
  87. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/UnrealEngineString.d.ts +13 -0
  88. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/UnrealEngineString.js +26 -0
  89. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/string_starts_with.d.ts +25 -0
  90. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/string_starts_with.js +20 -0
  91. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/typed_string.d.ts +14 -0
  92. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/typed_string.js +96 -0
  93. package/lib/TypeDefinitionDiscovery/Generator.d.ts +8 -0
  94. package/lib/TypeDefinitionDiscovery/Generator.js +8 -0
  95. package/lib/TypeDefinitionDiscovery/GeneratorDoesDiscovery.d.ts +8 -0
  96. package/lib/TypeDefinitionDiscovery/GeneratorDoesDiscovery.js +9 -0
  97. package/lib/TypeDefinitionDiscovery/JsonSchema/ArrayType.d.ts +19 -0
  98. package/lib/TypeDefinitionDiscovery/JsonSchema/ArrayType.js +61 -0
  99. package/lib/TypeDefinitionDiscovery/JsonSchema/Object/ExtendsObject.d.ts +23 -0
  100. package/lib/TypeDefinitionDiscovery/JsonSchema/Object/ExtendsObject.js +40 -0
  101. package/lib/TypeDefinitionDiscovery/JsonSchema/ObjectType.d.ts +91 -0
  102. package/lib/TypeDefinitionDiscovery/JsonSchema/ObjectType.js +76 -0
  103. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Const.d.ts +29 -0
  104. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Const.js +20 -0
  105. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum/BooleanEnum.d.ts +16 -0
  106. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum/BooleanEnum.js +47 -0
  107. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum.d.ts +40 -0
  108. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum.js +22 -0
  109. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Pattern.d.ts +13 -0
  110. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Pattern.js +21 -0
  111. package/lib/TypeDefinitionDiscovery/JsonSchema/String.d.ts +52 -0
  112. package/lib/TypeDefinitionDiscovery/JsonSchema/String.js +72 -0
  113. package/lib/TypeDefinitionDiscovery/JsonSchema/oneOf_or_anyOf.d.ts +63 -0
  114. package/lib/TypeDefinitionDiscovery/JsonSchema/oneOf_or_anyOf.js +47 -0
  115. package/lib/TypeDefinitionDiscovery.d.ts +49 -0
  116. package/lib/TypeDefinitionDiscovery.js +376 -0
  117. package/lib/TypeDefinitionWriter.d.ts +22 -0
  118. package/lib/TypeDefinitionWriter.js +233 -0
  119. package/lib/TypesDiscovery/CandidatesDiscovery.d.ts +10 -0
  120. package/lib/TypesDiscovery/CandidatesDiscovery.js +14 -0
  121. package/lib/TypesDiscovery/CustomParsingTypes/UnrealEngineString.d.ts +5 -0
  122. package/lib/TypesDiscovery/CustomParsingTypes/UnrealEngineString.js +18 -0
  123. package/lib/TypesDiscovery/CustomParsingTypes/typed_string.d.ts +6 -0
  124. package/lib/TypesDiscovery/CustomParsingTypes/typed_string.js +34 -0
  125. package/lib/TypesDiscovery/JsonSchema/$ref.d.ts +7 -0
  126. package/lib/TypesDiscovery/JsonSchema/$ref.js +33 -0
  127. package/lib/TypesDiscovery/JsonSchema/const.d.ts +6 -0
  128. package/lib/TypesDiscovery/JsonSchema/const.js +22 -0
  129. package/lib/TypesDiscovery/JsonSchema/enum.d.ts +6 -0
  130. package/lib/TypesDiscovery/JsonSchema/enum.js +22 -0
  131. package/lib/TypesDiscovery/JsonSchema/properties.d.ts +4 -0
  132. package/lib/TypesDiscovery/JsonSchema/properties.js +14 -0
  133. package/lib/TypesDiscovery/non_array_object_property.d.ts +4 -0
  134. package/lib/TypesDiscovery/non_array_object_property.js +11 -0
  135. package/lib/TypesDiscovery/non_empty_array_property.d.ts +4 -0
  136. package/lib/TypesDiscovery/non_empty_array_property.js +11 -0
  137. package/lib/TypesDiscovery.d.ts +24 -0
  138. package/lib/TypesDiscovery.js +77 -0
  139. package/lib/TypesGeneration/validators.d.ts +9 -0
  140. package/lib/TypesGeneration/validators.js +26 -0
  141. package/lib/TypesGeneration.d.ts +17 -0
  142. package/lib/TypesGeneration.js +53 -0
  143. package/lib/__dirname.d.ts +1 -0
  144. package/lib/__dirname.js +6 -0
  145. package/lib/helpers.d.ts +5 -0
  146. package/lib/helpers.js +29 -0
  147. package/lib/index.d.ts +8 -0
  148. package/lib/index.js +9 -0
  149. package/package.json +39 -0
  150. package/schema/update8.schema.json +8848 -0
  151. package/setup_PerformanceObserver.d.ts +3 -0
  152. package/setup_PerformanceObserver.js +55 -0
package/LICENSE.md ADDED
@@ -0,0 +1,190 @@
1
+ # Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2024 SignpostMarv
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ [![Coverage Status](https://coveralls.io/repos/github/satisfactory-dev/Docs.json.ts/badge.svg?branch=main)](https://coveralls.io/github/satisfactory-dev/Docs.json.ts?branch=main)
2
+ [![Workflow Status](https://github.com/satisfactory-dev/Docs.json.ts/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/satisfactory-dev/Docs.json.ts/actions/workflows/node.js.yml?query=branch%3Amain)
3
+
4
+ # Current Plan for Development:
5
+
6
+ - If [the relevant QA Site post](https://questions.satisfactorygame.com/post/65e5367dcd33105bd53f931f) gets resolved via a public announcement and/or the inclusion of a license:
7
+ - generated files will be included in the repo
8
+ - Docs.json _may_ be included
9
+ - Docs.utf8.json _may_ be included
10
+ - the contents of [data-progress.md](data-progress.md) do not indicate that data generation is _valid_, only that it spits out _something_.
11
+
12
+ # Using
13
+
14
+ ## Troubleshooting
15
+
16
+ - If `SyntaxError: Invalid or unexpected token` occurs
17
+ - Clear out previous precompiled Ajv validators
18
+ - Clear out the generated types folder
19
+ - If validation fails despite no apparent changes to the schema
20
+ - Clear out previous precompiled Ajv validators as the post-processing
21
+ (conversion of custom types to regex, etc.) may have changed.
22
+
23
+ ## Requirements
24
+
25
+ - Docker
26
+ - recommend vscode devcontainer support
27
+ - phpstorm's devcontainer support works but doesn't seem as capable
28
+ - A copy of Update 8's `Docs.json` file
29
+
30
+ ## Instructions
31
+
32
+ 1. Checkout locally
33
+ 1. Load in devcontainer-supporting IDE
34
+ - devcontainer setup should automatically run `make install`
35
+ - `NODE_OPTIONS` env var may require opening a fresh terminal if you
36
+ receieve an error along the lines of
37
+ `TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"`
38
+ 1. Copy `Docs.json` to `./data/`
39
+ 1. Run `make validate`
40
+ - if this fails, either the `Docs.json` is wrong or the schema is out-of-date
41
+ - if this succeeds, run `make generate`
42
+
43
+ ### IDE Integration
44
+
45
+ - [Docs.json.ts.dic](Docs.json.ts.dic) can be used by JetBrains' IDEs to suppress false-positive matches in the spellchecker as a result of the contents of `Docs.json`
46
+ - refer to JetBrains' own documentation for adding `.dic` files to the spell checking.
47
+ - `eslint` can result in the IDE slowing to a crawl if the `generated-types` folder is not excluded during development.
48
+
49
+ ## In a separate project
50
+
51
+ 1. run `npm install --save @satisfactory-dev/docs.json.ts`
52
+ 1. refer to [discover-types.ts](discover-types.ts) for how to generate the
53
+ types & data
54
+
55
+ - You will need to replace the usage of the `docs` helper with
56
+ something like the following (where `${__dirname}/data/` is the data
57
+ path in your new project):
58
+
59
+ ```ts
60
+ const __dirname = __dirname_from_meta(import.meta);
61
+ const ajv = new Ajv({
62
+ verbose: true,
63
+ code: {
64
+ source: true,
65
+ es5: false,
66
+ esm: true,
67
+ optimize: true,
68
+ },
69
+ });
70
+ configure_ajv(ajv);
71
+
72
+ export const docs = new DocsTsGenerator({
73
+ ajv,
74
+ docs_path: `${__dirname}/data/Docs.json`,
75
+ cache_path: `${__dirname}/data/`,
76
+ });
77
+ ```
78
+
79
+ # License
80
+
81
+ [see LICENSE.md](LICENSE.md)
@@ -0,0 +1,2 @@
1
+ import { ExpressionResult } from '../lib/DataDiscovery/Generator';
2
+ export declare function value_matches_ExpressionResult(maybe: unknown, expression_result: ExpressionResult, message?: string | Error): asserts maybe is typeof expression_result.expression;
@@ -0,0 +1,5 @@
1
+ import assert from 'assert';
2
+ export function value_matches_ExpressionResult(maybe, expression_result, message) {
3
+ assert.deepStrictEqual(maybe, expression_result.expression, message);
4
+ }
5
+ //# sourceMappingURL=CustomAssert.js.map
@@ -0,0 +1,7 @@
1
+ import Ajv, { SchemaObject, ValidateFunction } from 'ajv/dist/2020';
2
+ import { NoMatchError } from './Exceptions';
3
+ export declare class FailedToCompileSchema extends NoMatchError {
4
+ constructor(schema: SchemaObject, err: unknown, message?: string);
5
+ }
6
+ export declare function compile<T>(ajv: Ajv, schema: SchemaObject): ValidateFunction<T>;
7
+ export declare function esmify(code: string): string;
@@ -0,0 +1,59 @@
1
+ import { NoMatchError, } from './Exceptions';
2
+ const cache = new WeakMap();
3
+ const duplicate_compile_check = {};
4
+ export class FailedToCompileSchema extends NoMatchError {
5
+ constructor(schema, err, message = 'Failed to compile schema') {
6
+ super({ err, schema }, message);
7
+ }
8
+ }
9
+ export function compile(ajv, schema) {
10
+ try {
11
+ performance.mark('ajv compile start');
12
+ if (cache.has(schema)) {
13
+ const result = cache.get(schema);
14
+ performance.measure('ajv compile cached', 'ajv compile start');
15
+ return result;
16
+ }
17
+ const key = JSON.stringify(schema);
18
+ if (key in duplicate_compile_check) {
19
+ performance.measure('ajv compile duplicate', 'ajv compile start');
20
+ return duplicate_compile_check[key];
21
+ }
22
+ const result = ajv.compile(schema);
23
+ cache.set(schema, result);
24
+ duplicate_compile_check[key] = result;
25
+ performance.measure('ajv compile', 'ajv compile start');
26
+ return result;
27
+ }
28
+ catch (err) {
29
+ throw new FailedToCompileSchema(schema, err);
30
+ }
31
+ }
32
+ export function esmify(code) {
33
+ const replacements = {
34
+ 'require("ajv/dist/runtime/equal").default': [
35
+ 'fast_deep_equal',
36
+ `import fast_deep_equal from 'fast-deep-equal';`,
37
+ ],
38
+ 'require("ajv/dist/runtime/ucs2length").default': [
39
+ 'ucs2length.default',
40
+ `import ucs2length from 'ajv/dist/runtime/ucs2length';`,
41
+ ],
42
+ };
43
+ const import_these = [];
44
+ for (const entry of Object.entries(replacements)) {
45
+ const [look_for, [replace_with, add_to_import]] = entry;
46
+ if (code.includes(look_for)) {
47
+ code = code.replace(look_for, replace_with);
48
+ import_these.push(add_to_import);
49
+ }
50
+ }
51
+ if (import_these.length) {
52
+ code = code.replace(/^"use strict";/, [
53
+ '"use strict";',
54
+ ...import_these,
55
+ ].join(''));
56
+ }
57
+ return code;
58
+ }
59
+ //# sourceMappingURL=AjvUtilities.js.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Created due to annoyance over array.prototype.map()
3
+ * forcing [unknown, ...unknown[]] to unknown[]
4
+ */
5
+ export declare function non_empty_map<ItemInput = unknown, ItemOutput = unknown, Input extends [ItemInput, ...ItemInput[]] = [ItemInput, ...ItemInput[]], Output extends [
6
+ ItemOutput,
7
+ ...ItemOutput[]
8
+ ] = [
9
+ ItemOutput,
10
+ ...ItemOutput[]
11
+ ]>(array: Input, map: (item: ItemInput) => ItemOutput): Output;
12
+ type NonEmpty<T> = keyof T extends never ? never : T;
13
+ export declare function non_empty_keys<T extends {
14
+ [key: string]: unknown;
15
+ } = {
16
+ [key: string]: unknown;
17
+ }>(object: NonEmpty<T>): [string, ...string[]];
18
+ export declare function require_non_empty_array<Item = unknown, NotEmpty = [Item, ...Item[]]>(maybe: Item[]): NotEmpty;
19
+ export declare function object_keys<T extends {
20
+ [key: string]: unknown;
21
+ } = {
22
+ [key: string]: unknown;
23
+ }>(object: T): (keyof T)[];
24
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Created due to annoyance over array.prototype.map()
3
+ * forcing [unknown, ...unknown[]] to unknown[]
4
+ */
5
+ export function non_empty_map(array, map) {
6
+ return array.map(map);
7
+ }
8
+ export function non_empty_keys(object) {
9
+ return Object.keys(object);
10
+ }
11
+ export function require_non_empty_array(maybe) {
12
+ if (maybe.length < 1) {
13
+ throw new Error('Array is empty!');
14
+ }
15
+ return maybe;
16
+ }
17
+ // because typescript doesn't do this automatically
18
+ export function object_keys(object) {
19
+ return Object.keys(object);
20
+ }
21
+ //# sourceMappingURL=ArrayUtilities.js.map
@@ -0,0 +1,37 @@
1
+ export declare function object_has_property<Property extends string = string, Value = unknown>(maybe: unknown, property: Property, predicate?: undefined | ((maybe: unknown) => maybe is Value)): maybe is {
2
+ [key: string]: unknown;
3
+ } & {
4
+ [key in Property]: Value;
5
+ };
6
+ export declare function object_has_only_properties_that_match_predicate<Value = unknown>(maybe: unknown, predicate: (object_value: unknown) => object_value is Value): maybe is {
7
+ [key: string]: Value;
8
+ };
9
+ export declare function property_exists_on_object(object: {
10
+ [key: string]: unknown;
11
+ }, property: string): property is keyof object;
12
+ export declare function object_has_non_empty_array_property<Property extends string = string, Value = unknown>(maybe: unknown, property: Property, predicate?: undefined | ((inner_maybe: unknown) => inner_maybe is Value)): maybe is ({
13
+ [key: string]: unknown;
14
+ } & {
15
+ [key in Property]: [Value, ...Value[]];
16
+ });
17
+ export declare function object_has_property_that_equals(maybe: unknown, property: string, expects: unknown): maybe is {
18
+ [key: string]: unknown;
19
+ } & {
20
+ [key in typeof property]: typeof expects;
21
+ };
22
+ export declare function value_is_non_array_object(maybe: unknown): maybe is {
23
+ [key: string]: unknown;
24
+ };
25
+ export declare function is_non_empty_array<T = unknown>(maybe: unknown, predicate?: undefined | ((inner_maybe: unknown) => inner_maybe is T)): maybe is [T, ...T[]];
26
+ export declare function object_only_has_that_property<T = unknown>(maybe: unknown, property: string, predicate?: undefined | ((maybe: unknown) => maybe is T)): maybe is {
27
+ [key in typeof property]: T;
28
+ };
29
+ export declare function annoyingly_have_to_escape_property(property: string): string;
30
+ export declare abstract class SupportedSubSchemaType<ObjectType extends {
31
+ [key: string]: unknown;
32
+ } = {
33
+ [key: string]: unknown;
34
+ }> {
35
+ abstract is_supported_schema(maybe: unknown): maybe is ObjectType;
36
+ abstract value_regex(value: ObjectType): string;
37
+ }
@@ -0,0 +1,42 @@
1
+ export function object_has_property(maybe, property, predicate = undefined) {
2
+ return (value_is_non_array_object(maybe)
3
+ && property in maybe
4
+ && (undefined === predicate
5
+ || predicate(maybe[property])));
6
+ }
7
+ export function object_has_only_properties_that_match_predicate(maybe, predicate) {
8
+ return (value_is_non_array_object(maybe)
9
+ && Object.values(maybe).every(e => predicate(e)));
10
+ }
11
+ export function property_exists_on_object(object, property) {
12
+ return property in object;
13
+ }
14
+ export function object_has_non_empty_array_property(maybe, property, predicate = undefined) {
15
+ return (object_has_property(maybe, property)
16
+ && is_non_empty_array(maybe[property], predicate));
17
+ }
18
+ export function object_has_property_that_equals(maybe, property, expects) {
19
+ return object_has_property(maybe, property) && expects === maybe[property];
20
+ }
21
+ export function value_is_non_array_object(maybe) {
22
+ return ('object' === typeof maybe
23
+ && !(maybe instanceof Array)
24
+ && null !== maybe);
25
+ }
26
+ export function is_non_empty_array(maybe, predicate = undefined) {
27
+ return (maybe instanceof Array
28
+ && maybe.length >= 1
29
+ && (undefined === predicate || maybe.every((e) => predicate(e))));
30
+ }
31
+ export function object_only_has_that_property(maybe, property, predicate = undefined) {
32
+ return (value_is_non_array_object(maybe)
33
+ && object_has_property(maybe, property)
34
+ && 1 === Object.keys(maybe).length
35
+ && (undefined === predicate || predicate(maybe[property])));
36
+ }
37
+ export function annoyingly_have_to_escape_property(property) {
38
+ return property.replace(/([[\]])/g, '\\$1');
39
+ }
40
+ export class SupportedSubSchemaType {
41
+ }
42
+ //# sourceMappingURL=CustomPairingTypes.js.map