ballistics-engine 0.25.0 → 0.26.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.
@@ -55,6 +55,20 @@ export class Calculator {
55
55
  export class WasmBallistics {
56
56
  free(): void;
57
57
  [Symbol.dispose](): void;
58
+ /**
59
+ * Unload any custom drag table previously installed via [`Self::load_drag_table`],
60
+ * reverting every subsequent `trajectory`, `zero`, `lead`, and `monte-carlo` run to the
61
+ * standard G-model + BC drag (the `-b`/`--bc` value with the selected G1/G7 curve).
62
+ *
63
+ * The inverse of `loadDragTable`. It lets a single engine instance alternate between a
64
+ * measured-curve (CDM) solve and a plain G7-BC solve without constructing a second
65
+ * instance: `load → solve CDM → clear → solve G7`, with the G7 half uncontaminated —
66
+ * the same load/clear pattern `clearWindSegments` provides for segmented wind.
67
+ *
68
+ * Returns `true` if a table was loaded (and is now cleared), `false` if none was loaded
69
+ * (a harmless no-op). Idempotent.
70
+ */
71
+ clearDragTable(): boolean;
58
72
  /**
59
73
  * Report whether a BC5D table is currently loaded.
60
74
  */
@@ -107,3 +121,68 @@ export class WasmBallistics {
107
121
  */
108
122
  runCommand(command: string): string;
109
123
  }
124
+
125
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
126
+
127
+ export interface InitOutput {
128
+ readonly memory: WebAssembly.Memory;
129
+ readonly __wbg_calculator_free: (a: number, b: number) => void;
130
+ readonly __wbg_wasmballistics_free: (a: number, b: number) => void;
131
+ readonly calculator_addWindSegment: (a: number, b: number, c: number, d: number) => number;
132
+ readonly calculator_calculateTrajectory: (a: number, b: number) => [number, number, number];
133
+ readonly calculator_clearWindSegments: (a: number) => number;
134
+ readonly calculator_enableCoriolis: (a: number, b: number, c: number, d: number) => number;
135
+ readonly calculator_enableSpinDrift: (a: number, b: number, c: number, d: number) => number;
136
+ readonly calculator_getFullTrajectory: (a: number) => [number, number, number];
137
+ readonly calculator_new: () => number;
138
+ readonly calculator_setAltitude: (a: number, b: number) => number;
139
+ readonly calculator_setBC: (a: number, b: number) => number;
140
+ readonly calculator_setDiameter: (a: number, b: number) => number;
141
+ readonly calculator_setDragModel: (a: number, b: number, c: number) => number;
142
+ readonly calculator_setHumidity: (a: number, b: number) => number;
143
+ readonly calculator_setMass: (a: number, b: number) => number;
144
+ readonly calculator_setMaxRange: (a: number, b: number) => number;
145
+ readonly calculator_setPressure: (a: number, b: number) => number;
146
+ readonly calculator_setSightHeight: (a: number, b: number) => number;
147
+ readonly calculator_setTemperature: (a: number, b: number) => number;
148
+ readonly calculator_setVelocity: (a: number, b: number) => number;
149
+ readonly calculator_setWind: (a: number, b: number, c: number) => number;
150
+ readonly calculator_setZeroRange: (a: number, b: number) => number;
151
+ readonly wasmballistics_clearDragTable: (a: number) => number;
152
+ readonly wasmballistics_hasBc5dTable: (a: number) => number;
153
+ readonly wasmballistics_hasDragTable: (a: number) => number;
154
+ readonly wasmballistics_loadBc5dTable: (a: number, b: number, c: number) => [number, number, number, number];
155
+ readonly wasmballistics_loadDragTable: (a: number, b: number, c: number) => [number, number, number, number];
156
+ readonly wasmballistics_new: () => number;
157
+ readonly wasmballistics_runCommand: (a: number, b: number, c: number) => [number, number, number, number];
158
+ readonly __wbindgen_exn_store: (a: number) => void;
159
+ readonly __externref_table_alloc: () => number;
160
+ readonly __wbindgen_externrefs: WebAssembly.Table;
161
+ readonly __externref_table_dealloc: (a: number) => void;
162
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
163
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
164
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
165
+ readonly __wbindgen_start: () => void;
166
+ }
167
+
168
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
169
+
170
+ /**
171
+ * Instantiates the given `module`, which can either be bytes or
172
+ * a precompiled `WebAssembly.Module`.
173
+ *
174
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
175
+ *
176
+ * @returns {InitOutput}
177
+ */
178
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
179
+
180
+ /**
181
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
182
+ * for everything else, calls `WebAssembly.instantiate` directly.
183
+ *
184
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
185
+ *
186
+ * @returns {Promise<InitOutput>}
187
+ */
188
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;