Poindexter/npm/poindexter-wasm
Claude 298791ef95
feat: Add extended DNS record types (ClouDNS compatible)
- Add support for 13 additional record types: ALIAS, RP, SSHFP, TLSA,
  DS, DNSKEY, NAPTR, LOC, HINFO, CERT, SMIMEA, WR (Web Redirect), SPF
- Add GetDNSRecordTypeInfo() for metadata with RFC references
- Add GetCommonDNSRecordTypes() for commonly used types
- Add structured types for CAA, SSHFP, TLSA, DS, DNSKEY, NAPTR, RP,
  LOC, ALIAS, and WebRedirect records
- Export new functions in WASM bindings
- Update TypeScript definitions and loader.js
- Add comprehensive tests for new record types
2025-12-25 12:38:32 +00:00
..
index.d.ts feat: Add extended DNS record types (ClouDNS compatible) 2025-12-25 12:38:32 +00:00
LICENSE WebAssembly build and add TypeScript definitions for KDTree API 2025-11-03 20:15:55 +00:00
loader.cjs WebAssembly build and add TypeScript definitions for KDTree API 2025-11-03 20:15:55 +00:00
loader.js feat: Add extended DNS record types (ClouDNS compatible) 2025-12-25 12:38:32 +00:00
package.json WebAssembly build and add TypeScript definitions for KDTree API 2025-11-03 20:15:55 +00:00
PROJECT_README.md Add dual-backend support for KDTree with benchmarks and documentation updates 2025-11-04 01:44:16 +00:00
README.md WebAssembly build and add TypeScript definitions for KDTree API 2025-11-03 20:15:55 +00:00
smoke.mjs Add KDTree normalization helpers and TypeScript demo with Vite 2025-11-04 02:15:04 +00:00

@snider/poindexter-wasm

WebAssembly build of the Poindexter KD-Tree library for browsers. Designed to be consumed from Angular, React, or any ESM-capable bundler.

Status: experimental preview. API surface can evolve.

Install

Until published to npm, you can use a local file/path install:

# From the repo root where this folder exists
npm pack ./npm/poindexter-wasm
# Produces a tarball like snider-poindexter-wasm-0.0.0-development.tgz
# In your Angular project:
npm install ../Poindexter/snider-poindexter-wasm-0.0.0-development.tgz

Once published:

npm install @snider/poindexter-wasm

Usage (Angular/ESM)

// app.module.ts or a dedicated provider file
import { init } from '@snider/poindexter-wasm';

async function bootstrapPoindexter() {
  const px = await init();
  console.log(await px.version());

  const tree = await px.newTree(2);
  await tree.insert({ id: 'a', coords: [0, 0], value: 'A' });
  await tree.insert({ id: 'b', coords: [1, 1], value: 'B' });

  const nearest = await tree.nearest([0.2, 0.1]);
  console.log('nearest:', nearest);

  return { px, tree };
}

// Call bootstrapPoindexter() during app initialization

If your bundler cannot resolve asset URLs from import.meta.url, pass explicit URLs:

const px = await init({
  wasmURL: '/assets/poindexter/poindexter.wasm',
  wasmExecURL: '/assets/poindexter/wasm_exec.js',
});

To host the assets, copy node_modules/@snider/poindexter-wasm/dist/* into your app's public/assets folder during build (e.g., with Angular assets config in angular.json).

API

  • version(): Promise<string> Poindexter library version.
  • hello(name?: string): Promise<string> simple sanity check.
  • newTree(dim: number): Promise<Tree> create a new KD-Tree with given dimension.

Tree methods:

  • dim(): Promise<number>
  • len(): Promise<number>
  • insert(point: {id: string, coords: number[], value?: string}): Promise<boolean>
  • deleteByID(id: string): Promise<boolean>
  • nearest(query: number[]): Promise<{point, dist, found}>
  • kNearest(query: number[], k: number): Promise<{points, dists}>
  • radius(query: number[], r: number): Promise<{points, dists}>
  • exportJSON(): Promise<string> minimal metadata export for now.

Notes

  • Values are strings in this WASM build for simplicity across the boundary.
  • This package ships dist/poindexter.wasm and Go's wasm_exec.js. The loader adds required shims at runtime.
  • Requires a modern browser with WebAssembly support.