diff --git a/.changeset/add-find-table-column-to-wasm-api.md b/.changeset/add-find-table-column-to-wasm-api.md new file mode 100644 index 0000000000..79244ae784 --- /dev/null +++ b/.changeset/add-find-table-column-to-wasm-api.md @@ -0,0 +1,5 @@ +--- +"@milaboratories/pl-model-middle-layer": minor +--- + +Add `findTableColumn` method to `PFrameWasmAPI` interface diff --git a/lib/model/middle-layer/src/pframe/internal_api/api_wasm.ts b/lib/model/middle-layer/src/pframe/internal_api/api_wasm.ts index 77cb546d0b..4726db381f 100644 --- a/lib/model/middle-layer/src/pframe/internal_api/api_wasm.ts +++ b/lib/model/middle-layer/src/pframe/internal_api/api_wasm.ts @@ -4,6 +4,7 @@ import type { JoinEntry, PColumnSpec, PObjectId, + PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableSorting, @@ -36,8 +37,15 @@ export interface PFrameWasmAPI { /** * Finds the index of an axis matching the given selector. + * Returns -1 if no matching axis is found. */ findAxis(spec: AxesSpec, selector: SingleAxisSelector): number; + + /** + * Finds the flat index of a table column matching the given + * selector within a table spec. Returns -1 if not found. + */ + findTableColumn(tableSpec: PTableColumnSpec[], selector: PTableColumnId): number; } /** diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c61bd499a9..d214900635 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1807,7 +1807,7 @@ importers: version: 1.1.7(encoding@0.1.13) '@milaboratories/pframes-rs-wasm': specifier: 'catalog:' - version: 1.1.7(@bytecodealliance/preview2-shim@0.17.8)(@milaboratories/pl-model-common@1.24.11)(@milaboratories/pl-model-middle-layer@lib+model+middle-layer) + version: 1.1.7(@bytecodealliance/preview2-shim@0.17.8)(@milaboratories/pl-model-common@1.25.0)(@milaboratories/pl-model-middle-layer@lib+model+middle-layer) '@milaboratories/pl-model-middle-layer': specifier: workspace:* version: link:../../model/middle-layer @@ -4760,12 +4760,12 @@ packages: '@milaboratories/pl-error-like@1.12.8': resolution: {integrity: sha512-j8evT0YYuXQndVcsk8bOGfH9qpXRefFiO7uCdptG9Lz0QTv4e6OOxNUJPe9+TSp/72PXUsCrYGHUeTqtvUb0lA==} - '@milaboratories/pl-model-common@1.24.11': - resolution: {integrity: sha512-ldT4Xxn7j7l8ZvKEyI/s125lZXts7cEnuYIdVvlLo9uVFz+a8bGXK+cMFZls3QyqBW1RqOPwK3eIltqSRM4NZQ==} - '@milaboratories/pl-model-common@1.24.7': resolution: {integrity: sha512-xwuWCGxpxExvxNjtHhAm8zI4rSzhO0sLl7APQGD08O5MEz1oOZThjV71NEKt6ikLiVnaBmB0iMXLqJl5i9fIww==} + '@milaboratories/pl-model-common@1.25.0': + resolution: {integrity: sha512-ANeWlFstOCmHVuoQB1EpKLzgSaQ5eOSi43amzNbuakaybCVvoGHch7VHEshPrPSvhx8KddIVyU5UlS+WRl84/w==} + '@milaboratories/pl-model-middle-layer@1.11.9': resolution: {integrity: sha512-dlLdMp7hQKYH7YcsITjHxgwvOvP3YLQWmlkP8Rkp2QDIsFy1fo7PjQSchWlgt4eBhMlbWTCo3LosX2cc8ZB1sA==} @@ -10850,10 +10850,10 @@ snapshots: commander: 14.0.2 selfsigned: 5.5.0 - '@milaboratories/pframes-rs-wasm@1.1.7(@bytecodealliance/preview2-shim@0.17.8)(@milaboratories/pl-model-common@1.24.11)(@milaboratories/pl-model-middle-layer@lib+model+middle-layer)': + '@milaboratories/pframes-rs-wasm@1.1.7(@bytecodealliance/preview2-shim@0.17.8)(@milaboratories/pl-model-common@1.25.0)(@milaboratories/pl-model-middle-layer@lib+model+middle-layer)': dependencies: '@bytecodealliance/preview2-shim': 0.17.8 - '@milaboratories/pl-model-common': 1.24.11 + '@milaboratories/pl-model-common': 1.25.0 '@milaboratories/pl-model-middle-layer': link:lib/model/middle-layer '@milaboratories/pl-error-like@1.12.8': @@ -10861,13 +10861,13 @@ snapshots: json-stringify-safe: 5.0.1 zod: 3.23.8 - '@milaboratories/pl-model-common@1.24.11': + '@milaboratories/pl-model-common@1.24.7': dependencies: '@milaboratories/pl-error-like': 1.12.8 canonicalize: 2.1.0 zod: 3.23.8 - '@milaboratories/pl-model-common@1.24.7': + '@milaboratories/pl-model-common@1.25.0': dependencies: '@milaboratories/pl-error-like': 1.12.8 canonicalize: 2.1.0