ballistics-engine 0.25.1 → 0.30.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.
@@ -113,6 +113,13 @@ export class WasmBallistics {
113
113
  *
114
114
  * Returns a short human-readable summary of the loaded table (point count + Mach
115
115
  * range). Replaces any previously loaded table.
116
+ *
117
+ * MBA-1409: also accepts `.drg` vendor drag-curve text (the same format the native
118
+ * `--drag-table` CLI accepts by `.drg` file extension) as a fallback. WASM has no
119
+ * filesystem and thus no extension to dispatch on, so the bytes are tried as CSV first
120
+ * (exactly as before this change); only on CSV failure, if the text
121
+ * [`crate::drag_file::looks_like_drg`], it is retried through
122
+ * [`crate::drag_file::parse_drg`]. If both fail, the returned error names both formats.
116
123
  */
117
124
  loadDragTable(bytes: Uint8Array): string;
118
125
  constructor();
@@ -121,3 +128,68 @@ export class WasmBallistics {
121
128
  */
122
129
  runCommand(command: string): string;
123
130
  }
131
+
132
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
133
+
134
+ export interface InitOutput {
135
+ readonly memory: WebAssembly.Memory;
136
+ readonly __wbg_calculator_free: (a: number, b: number) => void;
137
+ readonly __wbg_wasmballistics_free: (a: number, b: number) => void;
138
+ readonly calculator_addWindSegment: (a: number, b: number, c: number, d: number) => number;
139
+ readonly calculator_calculateTrajectory: (a: number, b: number) => [number, number, number];
140
+ readonly calculator_clearWindSegments: (a: number) => number;
141
+ readonly calculator_enableCoriolis: (a: number, b: number, c: number, d: number) => number;
142
+ readonly calculator_enableSpinDrift: (a: number, b: number, c: number, d: number) => number;
143
+ readonly calculator_getFullTrajectory: (a: number) => [number, number, number];
144
+ readonly calculator_new: () => number;
145
+ readonly calculator_setAltitude: (a: number, b: number) => number;
146
+ readonly calculator_setBC: (a: number, b: number) => number;
147
+ readonly calculator_setDiameter: (a: number, b: number) => number;
148
+ readonly calculator_setDragModel: (a: number, b: number, c: number) => number;
149
+ readonly calculator_setHumidity: (a: number, b: number) => number;
150
+ readonly calculator_setMass: (a: number, b: number) => number;
151
+ readonly calculator_setMaxRange: (a: number, b: number) => number;
152
+ readonly calculator_setPressure: (a: number, b: number) => number;
153
+ readonly calculator_setSightHeight: (a: number, b: number) => number;
154
+ readonly calculator_setTemperature: (a: number, b: number) => number;
155
+ readonly calculator_setVelocity: (a: number, b: number) => number;
156
+ readonly calculator_setWind: (a: number, b: number, c: number) => number;
157
+ readonly calculator_setZeroRange: (a: number, b: number) => number;
158
+ readonly wasmballistics_clearDragTable: (a: number) => number;
159
+ readonly wasmballistics_hasBc5dTable: (a: number) => number;
160
+ readonly wasmballistics_hasDragTable: (a: number) => number;
161
+ readonly wasmballistics_loadBc5dTable: (a: number, b: number, c: number) => [number, number, number, number];
162
+ readonly wasmballistics_loadDragTable: (a: number, b: number, c: number) => [number, number, number, number];
163
+ readonly wasmballistics_new: () => number;
164
+ readonly wasmballistics_runCommand: (a: number, b: number, c: number) => [number, number, number, number];
165
+ readonly __wbindgen_exn_store: (a: number) => void;
166
+ readonly __externref_table_alloc: () => number;
167
+ readonly __wbindgen_externrefs: WebAssembly.Table;
168
+ readonly __externref_table_dealloc: (a: number) => void;
169
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
170
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
171
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
172
+ readonly __wbindgen_start: () => void;
173
+ }
174
+
175
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
176
+
177
+ /**
178
+ * Instantiates the given `module`, which can either be bytes or
179
+ * a precompiled `WebAssembly.Module`.
180
+ *
181
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
182
+ *
183
+ * @returns {InitOutput}
184
+ */
185
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
186
+
187
+ /**
188
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
189
+ * for everything else, calls `WebAssembly.instantiate` directly.
190
+ *
191
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
192
+ *
193
+ * @returns {Promise<InitOutput>}
194
+ */
195
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;