@rybosome/tspice 0.0.7 → 0.0.8

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 (214) hide show
  1. package/README.md +140 -78
  2. package/backend-contract/dist/.tsbuildinfo +1 -1
  3. package/backend-contract/dist/domains/cells-windows.d.ts +94 -0
  4. package/backend-contract/dist/domains/cells-windows.js +10 -0
  5. package/backend-contract/dist/domains/coords-vectors.d.ts +50 -0
  6. package/backend-contract/dist/domains/dsk.d.ts +49 -0
  7. package/backend-contract/dist/domains/dsk.js +2 -0
  8. package/backend-contract/dist/domains/ek.d.ts +186 -0
  9. package/backend-contract/dist/domains/ek.js +8 -0
  10. package/backend-contract/dist/domains/ephemeris.d.ts +141 -3
  11. package/backend-contract/dist/domains/error.d.ts +42 -0
  12. package/backend-contract/dist/domains/error.js +33 -0
  13. package/backend-contract/dist/domains/file-io.d.ts +114 -0
  14. package/backend-contract/dist/domains/file-io.js +8 -0
  15. package/backend-contract/dist/domains/frames.d.ts +40 -0
  16. package/backend-contract/dist/domains/geometry-gf.d.ts +44 -0
  17. package/backend-contract/dist/domains/geometry-gf.js +14 -0
  18. package/backend-contract/dist/domains/geometry.d.ts +21 -1
  19. package/backend-contract/dist/domains/ids-names-normalize.d.ts +3 -0
  20. package/backend-contract/dist/domains/ids-names-normalize.js +74 -0
  21. package/backend-contract/dist/domains/ids-names.d.ts +37 -0
  22. package/backend-contract/dist/domains/kernel-pool.d.ts +134 -0
  23. package/backend-contract/dist/domains/kernel-pool.js +2 -0
  24. package/backend-contract/dist/domains/kernels-utils.d.ts +44 -0
  25. package/backend-contract/dist/domains/kernels-utils.js +265 -0
  26. package/backend-contract/dist/domains/kernels.d.ts +39 -3
  27. package/backend-contract/dist/domains/time.d.ts +102 -0
  28. package/backend-contract/dist/index.d.ts +31 -3
  29. package/backend-contract/dist/index.js +15 -1
  30. package/backend-contract/dist/shared/errors.d.ts +6 -0
  31. package/backend-contract/dist/shared/errors.js +8 -0
  32. package/backend-contract/dist/shared/mat3.d.ts +26 -14
  33. package/backend-contract/dist/shared/mat3.js +46 -17
  34. package/backend-contract/dist/shared/mat6.d.ts +34 -0
  35. package/backend-contract/dist/shared/mat6.js +116 -0
  36. package/backend-contract/dist/shared/spice-handles.d.ts +20 -0
  37. package/backend-contract/dist/shared/spice-handles.js +82 -0
  38. package/backend-contract/dist/shared/spice-int.d.ts +32 -0
  39. package/backend-contract/dist/shared/spice-int.js +41 -0
  40. package/backend-contract/dist/shared/types.d.ts +106 -1
  41. package/backend-contract/dist/shared/vec.d.ts +54 -0
  42. package/backend-contract/dist/shared/vec.js +162 -0
  43. package/backend-fake/dist/.tsbuildinfo +1 -1
  44. package/backend-fake/dist/index.d.ts +19 -1
  45. package/backend-fake/dist/index.js +1103 -18
  46. package/backend-node/dist/.tsbuildinfo +1 -1
  47. package/backend-node/dist/codec/arrays.d.ts +9 -0
  48. package/backend-node/dist/codec/arrays.js +36 -0
  49. package/backend-node/dist/codec/errors.d.ts +6 -6
  50. package/backend-node/dist/codec/errors.js +6 -6
  51. package/backend-node/dist/domains/cells-windows.d.ts +5 -0
  52. package/backend-node/dist/domains/cells-windows.js +112 -0
  53. package/backend-node/dist/domains/coords-vectors.d.ts +1 -0
  54. package/backend-node/dist/domains/coords-vectors.js +64 -1
  55. package/backend-node/dist/domains/dsk.d.ts +6 -0
  56. package/backend-node/dist/domains/dsk.js +108 -0
  57. package/backend-node/dist/domains/ek.d.ts +10 -0
  58. package/backend-node/dist/domains/ek.js +100 -0
  59. package/backend-node/dist/domains/ephemeris.d.ts +5 -1
  60. package/backend-node/dist/domains/ephemeris.js +150 -1
  61. package/backend-node/dist/domains/error.d.ts +5 -0
  62. package/backend-node/dist/domains/error.js +34 -0
  63. package/backend-node/dist/domains/file-io.d.ts +7 -0
  64. package/backend-node/dist/domains/file-io.js +105 -0
  65. package/backend-node/dist/domains/frames.d.ts +1 -0
  66. package/backend-node/dist/domains/frames.js +52 -0
  67. package/backend-node/dist/domains/geometry-gf.d.ts +5 -0
  68. package/backend-node/dist/domains/geometry-gf.js +74 -0
  69. package/backend-node/dist/domains/geometry.d.ts +1 -0
  70. package/backend-node/dist/domains/geometry.js +62 -0
  71. package/backend-node/dist/domains/ids-names.d.ts +2 -1
  72. package/backend-node/dist/domains/ids-names.js +30 -0
  73. package/backend-node/dist/domains/kernel-pool.d.ts +5 -0
  74. package/backend-node/dist/domains/kernel-pool.js +74 -0
  75. package/backend-node/dist/domains/kernels.d.ts +1 -0
  76. package/backend-node/dist/domains/kernels.js +100 -13
  77. package/backend-node/dist/domains/time.d.ts +1 -0
  78. package/backend-node/dist/domains/time.js +75 -1
  79. package/backend-node/dist/index.d.ts +2 -0
  80. package/backend-node/dist/index.js +62 -1
  81. package/backend-node/dist/lowlevel/binding.d.ts +3 -0
  82. package/backend-node/dist/lowlevel/binding.js +115 -0
  83. package/backend-node/dist/runtime/addon.d.ts +271 -0
  84. package/backend-node/dist/runtime/addon.js +3 -0
  85. package/backend-node/dist/runtime/kernel-staging.d.ts +17 -0
  86. package/backend-node/dist/runtime/kernel-staging.js +80 -7
  87. package/backend-node/dist/runtime/spice-handles.d.ts +3 -0
  88. package/backend-node/dist/runtime/spice-handles.js +2 -0
  89. package/backend-node/dist/runtime/virtual-output-staging.d.ts +16 -0
  90. package/backend-node/dist/runtime/virtual-output-staging.js +148 -0
  91. package/backend-wasm/dist/.tsbuildinfo +1 -1
  92. package/backend-wasm/dist/codec/alloc.d.ts +19 -0
  93. package/backend-wasm/dist/codec/alloc.js +64 -0
  94. package/backend-wasm/dist/codec/calls.d.ts +2 -0
  95. package/backend-wasm/dist/codec/calls.js +13 -24
  96. package/backend-wasm/dist/codec/errors.d.ts +6 -0
  97. package/backend-wasm/dist/codec/errors.js +34 -2
  98. package/backend-wasm/dist/codec/found.d.ts +2 -0
  99. package/backend-wasm/dist/codec/found.js +20 -43
  100. package/backend-wasm/dist/codec/strings.d.ts +31 -1
  101. package/backend-wasm/dist/codec/strings.js +93 -6
  102. package/backend-wasm/dist/domains/cells-windows.d.ts +9 -0
  103. package/backend-wasm/dist/domains/cells-windows.js +392 -0
  104. package/backend-wasm/dist/domains/coords-vectors.d.ts +1 -0
  105. package/backend-wasm/dist/domains/coords-vectors.js +377 -187
  106. package/backend-wasm/dist/domains/dsk.d.ts +6 -0
  107. package/backend-wasm/dist/domains/dsk.js +179 -0
  108. package/backend-wasm/dist/domains/ek.d.ts +6 -0
  109. package/backend-wasm/dist/domains/ek.js +543 -0
  110. package/backend-wasm/dist/domains/ephemeris.d.ts +4 -1
  111. package/backend-wasm/dist/domains/ephemeris.js +405 -46
  112. package/backend-wasm/dist/domains/error.d.ts +5 -0
  113. package/backend-wasm/dist/domains/error.js +109 -0
  114. package/backend-wasm/dist/domains/file-io.d.ts +7 -0
  115. package/backend-wasm/dist/domains/file-io.js +462 -0
  116. package/backend-wasm/dist/domains/frames.d.ts +1 -0
  117. package/backend-wasm/dist/domains/frames.js +136 -4
  118. package/backend-wasm/dist/domains/geometry-gf.d.ts +5 -0
  119. package/backend-wasm/dist/domains/geometry-gf.js +178 -0
  120. package/backend-wasm/dist/domains/geometry.d.ts +1 -0
  121. package/backend-wasm/dist/domains/geometry.js +210 -0
  122. package/backend-wasm/dist/domains/ids-names.d.ts +2 -1
  123. package/backend-wasm/dist/domains/ids-names.js +89 -0
  124. package/backend-wasm/dist/domains/kernel-pool.d.ts +5 -0
  125. package/backend-wasm/dist/domains/kernel-pool.js +357 -0
  126. package/backend-wasm/dist/domains/kernels.d.ts +1 -0
  127. package/backend-wasm/dist/domains/kernels.js +91 -2
  128. package/backend-wasm/dist/domains/time.d.ts +2 -0
  129. package/backend-wasm/dist/domains/time.js +235 -133
  130. package/backend-wasm/dist/lowlevel/exports.d.ts +215 -1
  131. package/backend-wasm/dist/lowlevel/exports.js +217 -38
  132. package/backend-wasm/dist/runtime/create-backend-options.d.ts +21 -0
  133. package/backend-wasm/dist/runtime/create-backend.node.d.ts +7 -0
  134. package/backend-wasm/dist/runtime/create-backend.node.js +283 -12
  135. package/backend-wasm/dist/runtime/create-backend.web.d.ts +1 -0
  136. package/backend-wasm/dist/runtime/create-backend.web.js +40 -4
  137. package/backend-wasm/dist/runtime/fs.d.ts +5 -0
  138. package/backend-wasm/dist/runtime/fs.js +5 -0
  139. package/backend-wasm/dist/runtime/spice-handles.d.ts +3 -0
  140. package/backend-wasm/dist/runtime/spice-handles.js +2 -0
  141. package/backend-wasm/dist/runtime/virtual-outputs.d.ts +16 -0
  142. package/backend-wasm/dist/runtime/virtual-outputs.js +35 -0
  143. package/backend-wasm/dist/tspice_backend_wasm.node.js +3 -3
  144. package/backend-wasm/dist/tspice_backend_wasm.wasm +0 -0
  145. package/backend-wasm/dist/tspice_backend_wasm.web.js +1 -1
  146. package/core/dist/.tsbuildinfo +1 -1
  147. package/core/dist/index.d.ts +19 -8
  148. package/core/dist/index.js +19 -8
  149. package/dist/.tsbuildinfo +1 -1
  150. package/dist/backend.d.ts +5 -0
  151. package/dist/clients/createSpiceAsyncFromTransport.d.ts +5 -0
  152. package/dist/clients/createSpiceAsyncFromTransport.js +90 -0
  153. package/dist/clients/createSpiceSyncFromTransport.d.ts +5 -0
  154. package/dist/clients/createSpiceSyncFromTransport.js +88 -0
  155. package/dist/clients/spiceClients.d.ts +59 -0
  156. package/dist/clients/spiceClients.js +292 -0
  157. package/dist/errors.d.ts +4 -0
  158. package/dist/errors.js +4 -0
  159. package/dist/index.d.ts +10 -7
  160. package/dist/index.js +4 -3
  161. package/dist/kernels/defaultKernelPathFromUrl.d.ts +8 -0
  162. package/dist/kernels/defaultKernelPathFromUrl.js +32 -0
  163. package/dist/kernels/kernelPack.d.ts +88 -0
  164. package/dist/kernels/kernelPack.js +122 -0
  165. package/dist/kernels/kernels.d.ts +98 -0
  166. package/dist/kernels/kernels.js +217 -0
  167. package/dist/kernels/naifKernelId.d.ts +2 -0
  168. package/dist/kernels/naifKernelId.js +2 -0
  169. package/dist/kit/math/mat3.d.ts +9 -1
  170. package/dist/kit/math/mat3.js +9 -1
  171. package/dist/kit/spice/create-kit.d.ts +1 -0
  172. package/dist/kit/spice/create-kit.js +1 -0
  173. package/dist/kit/spice/frames.d.ts +1 -0
  174. package/dist/kit/spice/frames.js +1 -0
  175. package/dist/kit/spice/kernels.d.ts +1 -0
  176. package/dist/kit/spice/kernels.js +1 -0
  177. package/dist/kit/spice/state.d.ts +2 -1
  178. package/dist/kit/spice/state.js +8 -4
  179. package/dist/kit/spice/time.d.ts +1 -0
  180. package/dist/kit/spice/time.js +1 -0
  181. package/dist/kit/types/spice-types.d.ts +18 -1
  182. package/dist/spice.d.ts +10 -1
  183. package/dist/spice.js +41 -0
  184. package/dist/transport/caching/policy.d.ts +16 -0
  185. package/dist/transport/caching/policy.js +77 -0
  186. package/dist/transport/caching/withCaching.d.ts +125 -0
  187. package/dist/transport/caching/withCaching.js +335 -0
  188. package/dist/transport/caching/withCachingSync.d.ts +24 -0
  189. package/dist/transport/caching/withCachingSync.js +161 -0
  190. package/dist/transport/rpc/protocol.d.ts +35 -0
  191. package/dist/transport/rpc/protocol.js +56 -0
  192. package/dist/transport/rpc/taskScheduling.d.ts +20 -0
  193. package/dist/transport/rpc/taskScheduling.js +98 -0
  194. package/dist/transport/rpc/valueCodec.d.ts +5 -0
  195. package/dist/transport/rpc/valueCodec.js +106 -0
  196. package/dist/transport/types.d.ts +7 -0
  197. package/dist/transport/types.js +2 -0
  198. package/dist/types.d.ts +8 -5
  199. package/dist/types.js +2 -1
  200. package/dist/worker/browser/createSpiceWorker.d.ts +22 -0
  201. package/dist/worker/browser/createSpiceWorker.js +41 -0
  202. package/dist/worker/browser/createSpiceWorkerClient.d.ts +40 -0
  203. package/dist/worker/browser/createSpiceWorkerClient.js +99 -0
  204. package/dist/worker/browser/spiceWorkerEntry.d.ts +2 -0
  205. package/dist/worker/browser/spiceWorkerEntry.js +129 -0
  206. package/dist/worker/browser/spiceWorkerInlineSource.d.ts +2 -0
  207. package/dist/worker/browser/spiceWorkerInlineSource.js +4 -0
  208. package/dist/worker/index.d.ts +10 -0
  209. package/dist/worker/index.js +7 -0
  210. package/dist/worker/transport/createWorkerTransport.d.ts +69 -0
  211. package/dist/worker/transport/createWorkerTransport.js +398 -0
  212. package/dist/worker/transport/exposeTransportToWorker.d.ts +51 -0
  213. package/dist/worker/transport/exposeTransportToWorker.js +196 -0
  214. package/package.json +4 -4
@@ -1,17 +1,29 @@
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ */
1
7
  import type { Mat3RowMajor, SpiceVector3 } from "../shared/types.js";
8
+ /** Backend contract for basic coordinate transforms and vector/matrix math. */
2
9
  export interface CoordsVectorsApi {
10
+ /** SPICE `reclat_c`: rectangular -> latitudinal coordinates. */
3
11
  reclat(rect: SpiceVector3): {
4
12
  radius: number;
5
13
  lon: number;
6
14
  lat: number;
7
15
  };
16
+ /** SPICE `latrec_c`: latitudinal -> rectangular coordinates. */
8
17
  latrec(radius: number, lon: number, lat: number): SpiceVector3;
18
+ /** SPICE `recsph_c`: rectangular -> spherical coordinates. */
9
19
  recsph(rect: SpiceVector3): {
10
20
  radius: number;
11
21
  colat: number;
12
22
  lon: number;
13
23
  };
24
+ /** SPICE `sphrec_c`: spherical -> rectangular coordinates. */
14
25
  sphrec(radius: number, colat: number, lon: number): SpiceVector3;
26
+ /** SPICE `vnorm_c`: vector magnitude (Euclidean norm). */
15
27
  vnorm(v: SpiceVector3): number;
16
28
  /**
17
29
  * Compute the unit vector of `v`.
@@ -22,9 +34,47 @@ export interface CoordsVectorsApi {
22
34
  * This matches the NAIF CSPICE `vhat_c` definition.
23
35
  */
24
36
  vhat(v: SpiceVector3): SpiceVector3;
37
+ /** SPICE `vdot_c`: dot product of two vectors. */
25
38
  vdot(a: SpiceVector3, b: SpiceVector3): number;
39
+ /** SPICE `vcrss_c`: cross product of two vectors. */
26
40
  vcrss(a: SpiceVector3, b: SpiceVector3): SpiceVector3;
41
+ /** SPICE `vadd_c`: vector addition. */
42
+ vadd(a: SpiceVector3, b: SpiceVector3): SpiceVector3;
43
+ /** SPICE `vsub_c`: vector subtraction. */
44
+ vsub(a: SpiceVector3, b: SpiceVector3): SpiceVector3;
45
+ /** SPICE `vminus_c`: negate a vector. */
46
+ vminus(v: SpiceVector3): SpiceVector3;
47
+ /** SPICE `vscl_c`: multiply vector by scalar. */
48
+ vscl(s: number, v: SpiceVector3): SpiceVector3;
49
+ /** SPICE `mxm_c`: matrix-matrix multiplication. */
50
+ mxm(a: Mat3RowMajor, b: Mat3RowMajor): Mat3RowMajor;
51
+ /**
52
+ * Generate a rotation matrix representing a rotation about a coordinate axis.
53
+ *
54
+ * Axis is 1=x, 2=y, 3=z.
55
+ */
56
+ rotate(angle: number, axis: number): Mat3RowMajor;
57
+ /**
58
+ * Rotate a matrix about a coordinate axis.
59
+ *
60
+ * Axis is 1=x, 2=y, 3=z.
61
+ */
62
+ rotmat(m: Mat3RowMajor, angle: number, axis: number): Mat3RowMajor;
63
+ /**
64
+ * Convert an axis and angle to a rotation matrix.
65
+ */
66
+ axisar(axis: SpiceVector3, angle: number): Mat3RowMajor;
67
+ /** SPICE `georec_c`: geodetic lon/lat/alt -> rectangular coordinates. */
68
+ georec(lon: number, lat: number, alt: number, re: number, f: number): SpiceVector3;
69
+ /** SPICE `recgeo_c`: rectangular -> geodetic lon/lat/alt coordinates. */
70
+ recgeo(rect: SpiceVector3, re: number, f: number): {
71
+ lon: number;
72
+ lat: number;
73
+ alt: number;
74
+ };
75
+ /** SPICE `mxv_c`: multiply matrix by vector. */
27
76
  mxv(m: Mat3RowMajor, v: SpiceVector3): SpiceVector3;
77
+ /** SPICE `mtxv_c`: multiply transpose(matrix) by vector. */
28
78
  mtxv(m: Mat3RowMajor, v: SpiceVector3): SpiceVector3;
29
79
  }
30
80
  //# sourceMappingURL=coords-vectors.d.ts.map
@@ -0,0 +1,49 @@
1
+ import type { SpiceHandle, SpiceVector3 } from "../shared/types.js";
2
+ import type { SpiceIntCell } from "./cells-windows.js";
3
+ import type { DlaDescriptor } from "./file-io.js";
4
+ /** Segment descriptor returned by `dskgd` (CSPICE: `SpiceDSKDescr`). */
5
+ export type DskDescriptor = {
6
+ surfce: number;
7
+ center: number;
8
+ dclass: number;
9
+ dtype: number;
10
+ frmcde: number;
11
+ corsys: number;
12
+ /** Coordinate system parameters (CSPICE: `corpar[SPICE_DSK_NSYPAR]`). */
13
+ corpar: number[];
14
+ co1min: number;
15
+ co1max: number;
16
+ co2min: number;
17
+ co2max: number;
18
+ co3min: number;
19
+ co3max: number;
20
+ start: number;
21
+ stop: number;
22
+ };
23
+ /** Summary bookkeeping parameters for a type 2 DSK segment (CSPICE: `dskb02_c`). */
24
+ export type DskType2Bookkeeping = {
25
+ nv: number;
26
+ np: number;
27
+ nvxtot: number;
28
+ /** Vertex bounds: `[[xmin,xmax],[ymin,ymax],[zmin,zmax]]` (CSPICE: `vtxbds[3][2]`). */
29
+ vtxbds: [[number, number], [number, number], [number, number]];
30
+ voxsiz: number;
31
+ voxori: SpiceVector3;
32
+ vgrext: SpiceVector3;
33
+ cgscal: number;
34
+ vtxnpl: number;
35
+ voxnpt: number;
36
+ voxnpl: number;
37
+ };
38
+ /** Backend contract for DSK (Digital Shape Kernel) segment queries. */
39
+ export interface DskApi {
40
+ /** Return the set of body IDs for which the specified DSK has segments. */
41
+ dskobj(dsk: string, bodids: SpiceIntCell): void;
42
+ /** Return the set of surface IDs for which the specified DSK has segments. */
43
+ dsksrf(dsk: string, bodyid: number, srfids: SpiceIntCell): void;
44
+ /** Return the descriptor of a DSK segment. */
45
+ dskgd(handle: SpiceHandle, dladsc: DlaDescriptor): DskDescriptor;
46
+ /** Return the type 2 DSK segment bookkeeping parameters. */
47
+ dskb02(handle: SpiceHandle, dladsc: DlaDescriptor): DskType2Bookkeeping;
48
+ }
49
+ //# sourceMappingURL=dsk.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dsk.js.map
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ */
7
+ import type { SpiceHandle } from "../shared/types.js";
8
+ /**
9
+ * Result of running an EK query via `ekfind`.
10
+ *
11
+ * Notes:
12
+ * - `ekfind` has a *non-standard* error reporting mechanism: query parse/semantic
13
+ * failures are returned via an `error/errmsg` output pair rather than SPICE's
14
+ * global error state.
15
+ * - Backend implementations should surface that query-specific failure via this
16
+ * return type (no throw).
17
+ * - SPICE-signaled failures (e.g. no loaded EKs) should still throw.
18
+ */
19
+ export type EkFindResult = {
20
+ ok: true;
21
+ /** Number of matching rows. */
22
+ nmrows: number;
23
+ } | {
24
+ ok: false;
25
+ /** Query language parse/semantic error message returned by `ekfind_c`. */
26
+ errmsg: string;
27
+ };
28
+ /**
29
+ * Result of fetching an element from an EK query result set.
30
+ *
31
+ * This is a tri-state:
32
+ * - `{ found: false }`: the requested element doesn't exist (commonly `elment`
33
+ * is out of range for the entry).
34
+ * - `{ found: true, isNull: true }`: the entry exists but is SQL NULL.
35
+ * - `{ found: true, isNull: false, value: T }`: a concrete value.
36
+ */
37
+ export type EkGetResult<T> = {
38
+ found: false;
39
+ } | {
40
+ found: true;
41
+ isNull: true;
42
+ } | {
43
+ found: true;
44
+ isNull: false;
45
+ value: T;
46
+ };
47
+ /** Backend contract for EK (Events Kernel) file/query operations. */
48
+ export interface EkApi {
49
+ /** Open an existing EK file for read (see `ekopr_c`). */
50
+ ekopr(path: string): SpiceHandle;
51
+ /** Open an existing EK file for write (see `ekopw_c`). */
52
+ ekopw(path: string): SpiceHandle;
53
+ /**
54
+ * Create and open a new EK file for write (see `ekopn_c`).
55
+ *
56
+ * `ncomch` is the number of comment characters to allocate for the EK.
57
+ */
58
+ ekopn(path: string, ifname: string, ncomch: number): SpiceHandle;
59
+ /**
60
+ * Close an EK file opened via `ekopr` / `ekopw` / `ekopn` (see `ekcls_c`).
61
+ *
62
+ * Notes:
63
+ * - EK handles are explicit resources and are not automatically closed by `unload()` / `kclear()`.
64
+ * - If `path` was backed by byte-staged temp bytes, close EK handles before calling
65
+ * `unload()` / `kclear()` to allow best-effort temp file deletion (especially on Windows).
66
+ */
67
+ ekcls(handle: SpiceHandle): void;
68
+ /**
69
+ * Number of EK tables currently loaded (see `ekntab_c`).
70
+ *
71
+ * Postconditions:
72
+ * - Returns an integer count `n` with `0 <= n <= 2_147_483_647`.
73
+ * - Backends should validate this postcondition and throw if violated.
74
+ */
75
+ ekntab(): number;
76
+ /**
77
+ * Retrieve the EK table name by 0-based index (see `ektnam_c`).
78
+ *
79
+ * `n` must be in the range `0..ekntab()-1`.
80
+ */
81
+ ektnam(n: number): string;
82
+ /**
83
+ * Number of segments in an EK file opened via handle (see `eknseg_c`).
84
+ *
85
+ * Postconditions:
86
+ * - Returns an integer count `n` with `0 <= n <= 2_147_483_647`.
87
+ * - Backends should validate this postcondition and throw if violated.
88
+ */
89
+ eknseg(handle: SpiceHandle): number;
90
+ /**
91
+ * Execute an EK query (see `ekfind_c`).
92
+ *
93
+ * Notes:
94
+ * - EK query results live in CSPICE global state.
95
+ * - Beginning fast-write via `ekifld` can invalidate the active selection/result set.
96
+ * Avoid interleaving `ekfind`/`ekg*` reads with fast-write; rerun `ekfind` after fast-write
97
+ * if you need to read again.
98
+ */
99
+ ekfind(query: string): EkFindResult;
100
+ /**
101
+ * Fetch a character-valued element from the active query result set (see `ekgc_c`).
102
+ *
103
+ * Indices are 0-based per NAIF:
104
+ * - `selidx`: 0-based index of the selected item in the query's `SELECT` clause.
105
+ * - `row`: 0-based row index in the result set (`0..nmrows-1` from the last successful `ekfind`).
106
+ * - `elment`: 0-based element index within the cell entry (`0` for scalar entries).
107
+ */
108
+ ekgc(selidx: number, row: number, elment: number): EkGetResult<string>;
109
+ /**
110
+ * Fetch a double-valued element from the active query result set (see `ekgd_c`).
111
+ *
112
+ * Indices are 0-based per NAIF:
113
+ * - `selidx`: 0-based index of the selected item in the query's `SELECT` clause.
114
+ * - `row`: 0-based row index in the result set (`0..nmrows-1` from the last successful `ekfind`).
115
+ * - `elment`: 0-based element index within the cell entry (`0` for scalar entries).
116
+ */
117
+ ekgd(selidx: number, row: number, elment: number): EkGetResult<number>;
118
+ /**
119
+ * Fetch an integer-valued element from the active query result set (see `ekgi_c`).
120
+ *
121
+ * Indices are 0-based per NAIF:
122
+ * - `selidx`: 0-based index of the selected item in the query's `SELECT` clause.
123
+ * - `row`: 0-based row index in the result set (`0..nmrows-1` from the last successful `ekfind`).
124
+ * - `elment`: 0-based element index within the cell entry (`0` for scalar entries).
125
+ */
126
+ ekgi(selidx: number, row: number, elment: number): EkGetResult<number>;
127
+ /**
128
+ * Begin fast-write for a new EK segment (see `ekifld_c`).
129
+ *
130
+ * Returns `segno` (new segment number) and the `rcptrs` workspace array.
131
+ * `rcptrs` must be passed to the subsequent column-add calls and to `ekffld`.
132
+ *
133
+ * Notes:
134
+ * - Calling `ekifld` may invalidate the active EK query selection (from `ekfind`). If you need
135
+ * to read query results after starting fast-write, rerun `ekfind`.
136
+ */
137
+ ekifld(handle: SpiceHandle, tabnam: string, nrows: number, cnames: readonly string[], decls: readonly string[]): {
138
+ segno: number;
139
+ rcptrs: number[];
140
+ };
141
+ /**
142
+ * Add an integer column's data to a fast-write segment (see `ekacli_c`).
143
+ *
144
+ * Packing:
145
+ * - `entszs`, `nlflgs`, and `rcptrs` are per-row arrays and must have the same length
146
+ * `nrows` (the `nrows` passed to `ekifld`, i.e. `rcptrs.length`).
147
+ * - `ivals` is a packed array containing exactly `sum(entszs)` values.
148
+ *
149
+ * NULL rows (`nlflgs[i] === true`):
150
+ * - Variable-size columns: set `entszs[i] = 0` and do not include any values for that row.
151
+ * - Fixed-size columns (`SIZE = N`): include/pad `N` placeholder values for that row and set
152
+ * `entszs[i] = N` so `ivals.length === sum(entszs)` remains true.
153
+ */
154
+ ekacli(handle: SpiceHandle, segno: number, column: string, ivals: readonly number[], entszs: readonly number[], nlflgs: readonly boolean[], rcptrs: readonly number[]): void;
155
+ /**
156
+ * Add a double-precision column's data to a fast-write segment (see `ekacld_c`).
157
+ *
158
+ * Packing:
159
+ * - `entszs`, `nlflgs`, and `rcptrs` are per-row arrays and must have the same length
160
+ * `nrows` (the `nrows` passed to `ekifld`, i.e. `rcptrs.length`).
161
+ * - `dvals` is a packed array containing exactly `sum(entszs)` values.
162
+ *
163
+ * NULL rows (`nlflgs[i] === true`):
164
+ * - Variable-size columns: set `entszs[i] = 0` and do not include any values for that row.
165
+ * - Fixed-size columns (`SIZE = N`): include/pad `N` placeholder values for that row and set
166
+ * `entszs[i] = N` so `dvals.length === sum(entszs)` remains true.
167
+ */
168
+ ekacld(handle: SpiceHandle, segno: number, column: string, dvals: readonly number[], entszs: readonly number[], nlflgs: readonly boolean[], rcptrs: readonly number[]): void;
169
+ /**
170
+ * Add a character column's data to a fast-write segment (see `ekaclc_c`).
171
+ *
172
+ * Packing:
173
+ * - `entszs`, `nlflgs`, and `rcptrs` are per-row arrays and must have the same length
174
+ * `nrows` (the `nrows` passed to `ekifld`, i.e. `rcptrs.length`).
175
+ * - `cvals` is a packed array containing exactly `sum(entszs)` values.
176
+ *
177
+ * NULL rows (`nlflgs[i] === true`):
178
+ * - Variable-size columns: set `entszs[i] = 0` and do not include any values for that row.
179
+ * - Fixed-size columns (`SIZE = N`): include/pad `N` placeholder values for that row and set
180
+ * `entszs[i] = N` so `cvals.length === sum(entszs)` remains true.
181
+ */
182
+ ekaclc(handle: SpiceHandle, segno: number, column: string, cvals: readonly string[], entszs: readonly number[], nlflgs: readonly boolean[], rcptrs: readonly number[]): void;
183
+ /** Complete a fast-write segment (see `ekffld_c`). */
184
+ ekffld(handle: SpiceHandle, segno: number, rcptrs: readonly number[]): void;
185
+ }
186
+ //# sourceMappingURL=ek.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=ek.js.map
@@ -1,8 +1,146 @@
1
- import type { AbCorr, SpkezrResult, SpkposResult } from "../shared/types.js";
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ */
7
+ import type { AbCorr, Found, SpiceHandle, SpiceStateVector, SpkezrResult, SpkposResult, VirtualOutput } from "../shared/types.js";
8
+ import type { SpiceIntCell, SpiceWindow } from "./cells-windows.js";
9
+ /**
10
+ * Packed SPK segment descriptor (DAF summary) as a 5-double array.
11
+ *
12
+ * This is the packed form returned by `spksfs` and accepted by `spkuds`.
13
+ */
14
+ export type SpkPackedDescriptor = readonly [number, number, number, number, number];
15
+ /** Unpacked SPK segment descriptor (see `spkuds_c`). */
16
+ export type SpkUnpackedDescriptor = {
17
+ body: number;
18
+ center: number;
19
+ frame: number;
20
+ type: number;
21
+ first: number;
22
+ last: number;
23
+ baddr: number;
24
+ eaddr: number;
25
+ };
26
+ /** Backend contract for SPK/ephemeris computations (positions, states, segment inspection). */
2
27
  export interface EphemerisApi {
3
- /** Compute state (6-vector) and light time via `spkezr`. */
28
+ /**
29
+ * Compute state relative to observer using loaded kernels (see `spkezr_c`).
30
+ *
31
+ * Note: `abcorr` is a known set of SPICE aberration correction strings, but we allow arbitrary
32
+ * strings for forward-compatibility.
33
+ */
4
34
  spkezr(target: string, et: number, ref: string, abcorr: AbCorr | string, observer: string): SpkezrResult;
5
- /** Compute position (3-vector) and light time via `spkpos`. */
35
+ /**
36
+ * Compute position relative to observer using loaded kernels (see `spkpos_c`).
37
+ */
6
38
  spkpos(target: string, et: number, ref: string, abcorr: AbCorr | string, observer: string): SpkposResult;
39
+ /** Compute state (6-vector) and light time via `spkez` (numeric IDs). */
40
+ spkez(target: number, et: number, ref: string, abcorr: AbCorr | string, observer: number): SpkezrResult;
41
+ /** Compute position (3-vector) and light time via `spkezp` (numeric IDs). */
42
+ spkezp(target: number, et: number, ref: string, abcorr: AbCorr | string, observer: number): SpkposResult;
43
+ /** Compute geometric state (6-vector) and light time via `spkgeo` (numeric IDs). */
44
+ spkgeo(target: number, et: number, ref: string, observer: number): SpkezrResult;
45
+ /** Compute geometric position (3-vector) and light time via `spkgps` (numeric IDs). */
46
+ spkgps(target: number, et: number, ref: string, observer: number): SpkposResult;
47
+ /** Compute state (6-vector) of `target` relative to the solar system barycenter via `spkssb`. */
48
+ spkssb(target: number, et: number, ref: string): SpiceStateVector;
49
+ /**
50
+ * Compute the coverage window for an object in an SPK via `spkcov`.
51
+ *
52
+ * **Path semantics (backend-dependent):**
53
+ * - Node backend: `spk` is a host filesystem path.
54
+ * - WASM backend: `spk` is an Emscripten FS (virtual) path/id (typically the
55
+ * `path` you used in `furnsh({ path, bytes })`).
56
+ *
57
+ * **Output window requirements:** `cover` must be a valid, initialized window
58
+ * handle created by the backend (e.g. `newWindow(maxIntervals)`) and must have
59
+ * sufficient capacity for the merged output.
60
+ *
61
+ * **Error safety note:** Like CSPICE `spkcov_c`, if this routine throws while
62
+ * updating `cover` (including due to insufficient capacity), the contents of
63
+ * `cover` may be left in a corrupted/undefined state. If an error is thrown,
64
+ * do **not** keep using `cover`; free it and create a fresh window.
65
+ *
66
+ * **Window semantics:** `cover` is updated in place. Like CSPICE `spkcov_c`,
67
+ * coverage is **merged** with any intervals already present in `cover`.
68
+ * Clear the window first (e.g. `scard(0, cover)`) if you want to avoid
69
+ * accumulation.
70
+ */
71
+ spkcov(spk: string, idcode: number, cover: SpiceWindow): void;
72
+ /**
73
+ * Find the set of objects present in an SPK via `spkobj`.
74
+ *
75
+ * **Path semantics (backend-dependent):**
76
+ * - Node backend: `spk` is a host filesystem path.
77
+ * - WASM backend: `spk` is an Emscripten FS (virtual) path/id (typically the
78
+ * `path` you used in `furnsh({ path, bytes })`).
79
+ *
80
+ * **Output cell requirements:** `ids` must be a valid, initialized set cell
81
+ * handle created by the backend (e.g. `newIntCell(size)`) and must have
82
+ * sufficient capacity for the unioned output.
83
+ *
84
+ * **Error safety note:** Like CSPICE `spkobj_c`, if this routine throws while
85
+ * updating `ids` (including due to insufficient capacity), the contents of
86
+ * `ids` may be left in a corrupted/undefined state. If an error is thrown, do
87
+ * **not** keep using `ids`; free it and create a fresh cell.
88
+ *
89
+ * **Cell semantics:** `ids` is updated in place. Like CSPICE `spkobj_c`, the
90
+ * output is the **union** of the IDs already present in `ids` and the IDs
91
+ * found in `spk`.
92
+ * Clear the cell first (e.g. `scard(0, ids)`) if you want to
93
+ * avoid accumulation.
94
+ */
95
+ spkobj(spk: string, ids: SpiceIntCell): void;
96
+ /**
97
+ * Search loaded SPK files for the highest-priority segment applicable to `body` and `et`.
98
+ *
99
+ * Note: `handle` is the native SPICE DAF handle for the file containing the segment.
100
+ */
101
+ spksfs(body: number, et: number): Found<{
102
+ handle: number;
103
+ descr: SpkPackedDescriptor;
104
+ ident: string;
105
+ }>;
106
+ /** Pack an SPK segment descriptor via `spkpds`. */
107
+ spkpds(body: number, center: number, frame: string, type: number, first: number, last: number): SpkPackedDescriptor;
108
+ /** Unpack a packed SPK segment descriptor via `spkuds`. */
109
+ spkuds(descr: SpkPackedDescriptor): SpkUnpackedDescriptor;
110
+ /**
111
+ * Open a new SPK file for write (see `spkopn_c`).
112
+ *
113
+ * `file` interpretation is backend-dependent:
114
+ * - Node: OS filesystem path
115
+ * - WASM: virtual id under the backend's virtual filesystem (currently
116
+ * normalized into `/kernels/...`).
117
+ *
118
+ * In other words, for the WASM backend, `file: string` is **not** a raw
119
+ * Emscripten absolute path. It is treated like other "kernel-ish" paths and
120
+ * is normalized into `/kernels`.
121
+ *
122
+ * Examples (WASM backend):
123
+ * - `spkopn("out.bsp", ...)` writes to `/kernels/out.bsp`
124
+ * - `spkopn("/kernels/out.bsp", ...)` refers to the same file
125
+ * - `spkopn("/tmp/out.bsp", ...)` throws (OS paths/URLs are rejected)
126
+ *
127
+ * When `file` is a `VirtualOutput`, backends should allow reading bytes back
128
+ * via `readVirtualOutput()` after closing the file handle.
129
+ *
130
+ * Callers should retain the `VirtualOutput` they passed to `spkopn`/`spkopa`.
131
+ * It is the identifier used to read bytes back later.
132
+ */
133
+ spkopn(file: string | VirtualOutput, ifname: string, ncomch: number): SpiceHandle;
134
+ /** Open an existing SPK for append (see `spkopa_c`). Same `file` semantics as `spkopn`. */
135
+ spkopa(file: string | VirtualOutput): SpiceHandle;
136
+ /** Close an SPK file previously opened by `spkopn`/`spkopa` (see `spkcls_c`). */
137
+ spkcls(handle: SpiceHandle): void;
138
+ /**
139
+ * Write a type 8 SPK segment (see `spkw08_c`).
140
+ *
141
+ * `states` is a flat array with layout `[x,y,z, dx,dy,dz]` for each record.
142
+ * The number of records `n` is derived as `states.length / 6`.
143
+ */
144
+ spkw08(handle: SpiceHandle, body: number, center: number, frame: string, first: number, last: number, segid: string, degree: number, states: readonly number[] | Float64Array, epoch1: number, step: number): void;
7
145
  }
8
146
  //# sourceMappingURL=ephemeris.d.ts.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ *
7
+ * Error policy:
8
+ * - Backend methods throw for SPICE-signaled failures.
9
+ * - "Found-style" routines (e.g. `bodn2c`, `bodc2n`, `namfrm`, ...) must **not** throw when
10
+ * SPICE reports "not found" via a `found` output flag; they return `{ found: false }`.
11
+ */
12
+ /** Subset of CSPICE error/status utilities exposed by tspice backends. */
13
+ export declare const GETMSG_WHICH_VALUES: readonly ["SHORT", "LONG", "EXPLAIN"];
14
+ export type GetmsgWhich = (typeof GETMSG_WHICH_VALUES)[number];
15
+ /** Type guard for {@link GetmsgWhich}. */
16
+ export declare function isGetmsgWhich(which: unknown): which is GetmsgWhich;
17
+ /**
18
+ * Runtime validation for `getmsg(which)`.
19
+ *
20
+ * Even though `which` is a narrow union type, callers may still pass arbitrary
21
+ * values at runtime (e.g. JS consumers, `as any`, etc.). Backends must reject
22
+ * invalid selectors rather than forwarding them to CSPICE.
23
+ */
24
+ export declare function assertGetmsgWhich(which: unknown): asserts which is GetmsgWhich;
25
+ /** Backend contract for SPICE error/status utilities (failed/reset/getmsg/etc). */
26
+ export interface ErrorApi {
27
+ /** Return `true` if the CSPICE error status is currently set. */
28
+ failed(): boolean;
29
+ /** Reset/clear the CSPICE error status and messages. */
30
+ reset(): void;
31
+ /** Get a CSPICE error message component. */
32
+ getmsg(which: GetmsgWhich): string;
33
+ /** Set the long error message text used by `sigerr()`. */
34
+ setmsg(message: string): void;
35
+ /** Signal a CSPICE error with the provided short error code (e.g. `"SPICE(BADTIME)"`). */
36
+ sigerr(short: string): void;
37
+ /** Add `name` to the CSPICE traceback stack. */
38
+ chkin(name: string): void;
39
+ /** Remove `name` from the CSPICE traceback stack. */
40
+ chkout(name: string): void;
41
+ }
42
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ *
7
+ * Error policy:
8
+ * - Backend methods throw for SPICE-signaled failures.
9
+ * - "Found-style" routines (e.g. `bodn2c`, `bodc2n`, `namfrm`, ...) must **not** throw when
10
+ * SPICE reports "not found" via a `found` output flag; they return `{ found: false }`.
11
+ */
12
+ /** Subset of CSPICE error/status utilities exposed by tspice backends. */
13
+ export const GETMSG_WHICH_VALUES = ["SHORT", "LONG", "EXPLAIN"];
14
+ /** Type guard for {@link GetmsgWhich}. */
15
+ export function isGetmsgWhich(which) {
16
+ return (which === "SHORT" ||
17
+ which === "LONG" ||
18
+ which === "EXPLAIN");
19
+ }
20
+ /**
21
+ * Runtime validation for `getmsg(which)`.
22
+ *
23
+ * Even though `which` is a narrow union type, callers may still pass arbitrary
24
+ * values at runtime (e.g. JS consumers, `as any`, etc.). Backends must reject
25
+ * invalid selectors rather than forwarding them to CSPICE.
26
+ */
27
+ export function assertGetmsgWhich(which) {
28
+ if (isGetmsgWhich(which))
29
+ return;
30
+ const allowed = GETMSG_WHICH_VALUES.map((v) => JSON.stringify(v)).join(" | ");
31
+ throw new TypeError(`getmsg(which) expected one of ${allowed} (got ${JSON.stringify(which)})`);
32
+ }
33
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Contract conventions:
3
+ * - Inputs are assumed validated at the backend boundary; the contract itself is primarily type-level.
4
+ * - Methods throw on invalid arguments or SPICE errors.
5
+ * - Lookups that may legitimately miss return `Found<T>` (`{ found: false }`) instead of throwing.
6
+ */
7
+ import type { SpiceHandle, VirtualOutput } from "../shared/types.js";
8
+ /**
9
+ * Plain-object representation of CSPICE `SpiceDLADescr`.
10
+ *
11
+ * These are the 8 integer components of a DLA descriptor.
12
+ *
13
+ * ## Portability
14
+ *
15
+ * Each field is an **int32** (32-bit signed integer). Backend implementations
16
+ * must reject (throw) non-integers and values outside the int32 range to
17
+ * prevent silent truncation across native/WASM boundaries.
18
+ *
19
+ * This matches tspice's project-wide assumption that `SpiceInt` is 32-bit
20
+ * (`sizeof(SpiceInt) == 4`) in all supported builds.
21
+ */
22
+ export type DlaDescriptor = {
23
+ bwdptr: number;
24
+ fwdptr: number;
25
+ ibase: number;
26
+ isize: number;
27
+ dbase: number;
28
+ dsize: number;
29
+ cbase: number;
30
+ csize: number;
31
+ };
32
+ export type FoundDlaDescriptor = {
33
+ found: false;
34
+ } | {
35
+ found: true;
36
+ descr: DlaDescriptor;
37
+ };
38
+ /** Backend contract for SPICE file I/O primitives (DAF/DAS/DLA + virtual outputs). */
39
+ export interface FileIoApi {
40
+ /** Returns whether a file exists at `path`. */
41
+ exists(path: string): boolean;
42
+ /** Determine SPICE file architecture + type (see `getfat_c`). */
43
+ getfat(path: string): {
44
+ arch: string;
45
+ type: string;
46
+ };
47
+ /**
48
+ * Read back bytes for a previously-created virtual output file.
49
+ *
50
+ * Notes:
51
+ * - Virtual outputs are only guaranteed to be readable after their associated
52
+ * writer handle has been closed (e.g. `spkcls(handle)` for SPK outputs).
53
+ * - Backends may reject reads for outputs they did not create via a writer
54
+ * API. This is intentionally **not** a general filesystem read.
55
+ */
56
+ readVirtualOutput(output: VirtualOutput): Uint8Array;
57
+ /** Open a DAF file for read (see `dafopr_c`). */
58
+ dafopr(path: string): SpiceHandle;
59
+ /** Close a DAF file previously opened by `dafopr()`. */
60
+ dafcls(handle: SpiceHandle): void;
61
+ /** Begin a forward search for arrays in the given DAF file (see `dafbfs_c`). */
62
+ dafbfs(handle: SpiceHandle): void;
63
+ /**
64
+ * Find the next DAF array (see `daffna_c`).
65
+ *
66
+ * Backend implementations should select the current DAF via `dafcs_c(handle)`
67
+ * before calling `daffna_c` to support interleaving multiple DAF searches.
68
+ */
69
+ daffna(handle: SpiceHandle): boolean;
70
+ /** Open a DAS file for read (see `dasopr_c`). */
71
+ dasopr(path: string): SpiceHandle;
72
+ /**
73
+ * Close a DAS-backed file handle.
74
+ *
75
+ * In CSPICE, `dascls_c` closes both DAS and DLA handles, and `dlacls_c` is an
76
+ * alias. We mirror that behavior: `dascls` and `dlacls` are interchangeable
77
+ * and accept handles returned from either `dasopr()` (read) or `dlaopn()`
78
+ * (write).
79
+ */
80
+ dascls(handle: SpiceHandle): void;
81
+ /** Create and open a DLA file for write (see `dlaopn_c`). */
82
+ dlaopn(path: string, ftype: string, ifname: string, ncomch: number): SpiceHandle;
83
+ /**
84
+ * Begin a forward search for DLA segments (see `dlabfs_c`).
85
+ *
86
+ * DLA is DAS-backed: `handle` must be a DAS handle to a DLA file, opened via
87
+ * `dasopr()` (read) or `dlaopn()` (write).
88
+ */
89
+ dlabfs(handle: SpiceHandle): FoundDlaDescriptor;
90
+ /**
91
+ * Find the next DLA segment after `descr` (see `dlafns_c`).
92
+ *
93
+ * DLA is DAS-backed: `handle` must be a DAS handle to a DLA file, opened via
94
+ * `dasopr()` (read) or `dlaopn()` (write).
95
+ */
96
+ dlafns(handle: SpiceHandle, descr: DlaDescriptor): FoundDlaDescriptor;
97
+ /**
98
+ * Close a DAS-backed DLA handle.
99
+ *
100
+ * Provided for parity with CSPICE `dlacls_c`, but implemented as an alias of
101
+ * `dascls` (same handle compatibility).
102
+ */
103
+ dlacls(handle: SpiceHandle): void;
104
+ /** Create and open a DSK file for write (see `dskopn_c`). */
105
+ dskopn(path: string, ifname: string, ncomch: number): SpiceHandle;
106
+ /** Build the spatial index for a type 2 DSK segment (see `dskmi2_c`). */
107
+ dskmi2(nv: number, vrtces: readonly number[], np: number, plates: readonly number[], finscl: number, corscl: number, worksz: number, voxpsz: number, voxlsz: number, makvtl: boolean, spxisz: number): {
108
+ spaixd: number[];
109
+ spaixi: number[];
110
+ };
111
+ /** Write a type 2 segment to a DSK file opened by `dskopn` (see `dskw02_c`). */
112
+ dskw02(handle: SpiceHandle, center: number, surfid: number, dclass: number, frame: string, corsys: number, corpar: readonly number[], mncor1: number, mxcor1: number, mncor2: number, mxcor2: number, mncor3: number, mxcor3: number, first: number, last: number, nv: number, vrtces: readonly number[], np: number, plates: readonly number[], spaixd: readonly number[], spaixi: readonly number[]): void;
113
+ }
114
+ //# sourceMappingURL=file-io.d.ts.map