@stll/anonymize-wasm 2.5.0 → 2.6.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.
- package/README.md +11 -20
- package/dist/native/index.js +1785 -0
- package/dist/native/{index.wasm32-wasi.wasm → index_bg.wasm} +0 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/dist/wasm.d.mts +80 -72
- package/dist/wasm.mjs +239 -106
- package/dist/wasm.mjs.map +1 -1
- package/package.json +1 -4
- package/dist/native/index.wasi-browser.js +0 -12020
- package/dist/native/index.wasi.cjs +0 -132
- package/dist/native/wasi-worker-browser.mjs +0 -10766
- package/dist/native/wasi-worker.mjs +0 -63
|
Binary file
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
2
|
//#region src/vite.d.ts
|
|
3
3
|
/** Which bundled `.stlanonpkg` prepared packages the plugin emits into a
|
|
4
|
-
* production build. The wasm binary
|
|
4
|
+
* production build. The wasm binary and glue are always emitted; only
|
|
5
5
|
* the prepared packages are selectable because they dominate the output size.
|
|
6
6
|
*
|
|
7
7
|
* - `"all"` (default): every bundled package, preserving prior behavior.
|
package/dist/vite.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { readFile, readdir } from "node:fs/promises";
|
|
2
2
|
import { basename, dirname, join } from "node:path";
|
|
3
3
|
//#region src/vite.ts
|
|
4
|
-
const OPTIMIZE_EXCLUDE = ["@stll/anonymize-wasm"
|
|
4
|
+
const OPTIMIZE_EXCLUDE = ["@stll/anonymize-wasm"];
|
|
5
5
|
const NATIVE_DIR = "native";
|
|
6
|
-
/** The
|
|
6
|
+
/** The generated glue is always shipped in `native/`; any file there works as the
|
|
7
7
|
* anchor. `new URL(fileName, <anchor>)` resolves to `native/<fileName>` because
|
|
8
8
|
* URL resolution replaces the anchor's last path segment. */
|
|
9
|
-
const ANCHOR_FILE = "index.
|
|
9
|
+
const ANCHOR_FILE = "index.js";
|
|
10
10
|
/** The exact `assetUrl` base expression emitted by the build (see wasm.ts).
|
|
11
11
|
* Kept in sync with the compiled `wasm.mjs`; the transform fails loudly if the
|
|
12
12
|
* dist shape drifts so this cannot silently ship broken asset paths. */
|
package/dist/vite.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.mjs","names":[],"sources":["../../src/vite.ts"],"sourcesContent":["/* Vite plugin that wires up @stll/anonymize-wasm so its wasm binding and\n * prepared-package assets survive both Vite's dev pre-bundler and a production\n * `vite build`.\n *\n * The package loads its napi-rs binding and bundled `.stlanonpkg` packages at\n * runtime from its own `native/` asset directory via\n * `new URL(\"./native/…\", import.meta.url)` (the wasm module, the WASI worker,\n * the glue, and the packages). The paths are computed at runtime, so neither\n * Vite's optimizer nor Rollup's static `new URL(…, import.meta.url)` handling\n * can follow them on their own.\n *\n * Dev (`vite serve`): the package plus the `@napi-rs/wasm-runtime` loader are\n * added to `optimizeDeps.exclude`, keeping their original on-disk paths so the\n * relative URLs resolve next to the package's own files.\n *\n * Build (`vite build`): Rollup bundles `wasm.mjs` into a chunk, rewriting\n * `import.meta.url`, and never copies the `native/` files. This plugin emits\n * the wasm binary + glue as build assets under a stable `native/` subdir, emits\n * the selected `.stlanonpkg` prepared packages (see {@link\n * AnonymizeWasmPluginOptions.packages}), and re-anchors the package's\n * `assetUrl` base onto a Rollup file-URL reference, so the runtime URLs resolve\n * to the emitted assets from whatever chunk ends up referencing them. The\n * glue's own internal `new URL(…, import.meta.url)` references (its `.wasm` and\n * worker) keep working because the glue directory is emitted side by side.\n *\n * The bundled prepared packages dominate the emitted size (the default\n * full-dictionary package alone is ~20 MB, plus per-language variants). An app\n * that only ever calls `loadPipeline` with its own package, or\n * `loadDefaultPipeline(language)` for a known subset of languages, can drop the\n * rest with the `packages` option instead of shipping every bundled package.\n */\nimport { readdir, readFile } from \"node:fs/promises\";\nimport { basename, dirname, join } from \"node:path\";\nimport type { Plugin } from \"vite\";\n\nconst OPTIMIZE_EXCLUDE = [\"@stll/anonymize-wasm\", \"@napi-rs/wasm-runtime\"];\nconst NATIVE_DIR = \"native\";\n/** The Node glue is always shipped in `native/`; any file there works as the\n * anchor. `new URL(fileName, <anchor>)` resolves to `native/<fileName>` because\n * URL resolution replaces the anchor's last path segment. */\nconst ANCHOR_FILE = \"index.wasi.cjs\";\n/** The exact `assetUrl` base expression emitted by the build (see wasm.ts).\n * Kept in sync with the compiled `wasm.mjs`; the transform fails loudly if the\n * dist shape drifts so this cannot silently ship broken asset paths. */\nconst ASSET_URL_BASE = \"`./${NATIVE_ASSET_DIR}/${fileName}`, import.meta.url\";\n\n/** Prepared packages are named `native-pipeline.stlanonpkg` (the full-dictionary\n * default) and `native-pipeline.<language>.stlanonpkg` (scoped variants). */\nconst PACKAGE_SUFFIX = \".stlanonpkg\";\nconst PACKAGE_PREFIX = \"native-pipeline.\";\nconst DEFAULT_PACKAGE_FILE = `${PACKAGE_PREFIX}stlanonpkg`;\n/** Selection name for the full-dictionary default package. Every other name is\n * a language code that maps to `native-pipeline.<name>.stlanonpkg`. */\nconst DEFAULT_PACKAGE_NAME = \"default\";\n\n/** Which bundled `.stlanonpkg` prepared packages the plugin emits into a\n * production build. The wasm binary, glue, and workers are always emitted; only\n * the prepared packages are selectable because they dominate the output size.\n *\n * - `\"all\"` (default): every bundled package, preserving prior behavior.\n * - `\"none\"`: no prepared packages. The consumer must supply its own package to\n * `loadPipeline`; `loadDefaultPipeline()` then fails at runtime with a fetch\n * error because the asset was never emitted.\n * - a name list: only these packages. Use `\"default\"` for the full-dictionary\n * package and a language code (e.g. `\"cs\"`, `\"de\"`, `\"en\"`) for a scoped one,\n * for example `[\"cs\"]` or `[\"default\", \"en\"]`. A requested package that is\n * not bundled fails the build. */\nexport type AnonymizeWasmPackages = \"all\" | \"none\" | readonly string[];\n\nexport type AnonymizeWasmPluginOptions = {\n packages?: AnonymizeWasmPackages;\n};\n\nconst isWasmEntry = (id: string): boolean =>\n id.includes(\"anonymize-wasm\") && basename(id) === \"wasm.mjs\";\n\nconst isPackageFile = (file: string): boolean => file.endsWith(PACKAGE_SUFFIX);\n\n/** Map a selection name to its on-disk package file name. */\nconst packageFileName = (name: string): string =>\n name === DEFAULT_PACKAGE_NAME\n ? DEFAULT_PACKAGE_FILE\n : `${PACKAGE_PREFIX}${name}${PACKAGE_SUFFIX}`;\n\ntype PackageSelection =\n | { status: \"ok\"; emit: ReadonlySet<string> }\n | { status: \"missing\"; names: string[]; available: string[] }\n | { status: \"invalid\"; value: string };\n\n/** Resolve which prepared-package files to emit for the given selection,\n * validating that every explicitly requested name exists in `nativeFiles`. */\nconst resolvePackageSelection = (\n nativeFiles: readonly string[],\n packages: AnonymizeWasmPackages,\n): PackageSelection => {\n const packageFiles = nativeFiles.filter(isPackageFile);\n if (packages === \"all\") {\n return { status: \"ok\", emit: new Set(packageFiles) };\n }\n if (packages === \"none\") {\n return { status: \"ok\", emit: new Set() };\n }\n if (!Array.isArray(packages)) {\n // A bare string like \"cs\" would otherwise iterate per character below.\n return { status: \"invalid\", value: String(packages) };\n }\n const available = new Set(packageFiles);\n const emit = new Set<string>();\n const missing: string[] = [];\n for (const name of packages) {\n const fileName = packageFileName(name);\n if (available.has(fileName)) {\n emit.add(fileName);\n } else {\n missing.push(name);\n }\n }\n if (missing.length > 0) {\n return { status: \"missing\", names: missing, available: packageFiles };\n }\n return { status: \"ok\", emit };\n};\n\nexport default function stllAnonymizeWasmVite(\n options: AnonymizeWasmPluginOptions = {},\n): Plugin {\n const packages = options.packages ?? \"all\";\n let isBuild = false;\n return {\n name: \"stll-anonymize-wasm\",\n // optimizeDeps only affects dev; harmless (ignored) during build.\n config() {\n return { optimizeDeps: { exclude: OPTIMIZE_EXCLUDE } };\n },\n configResolved(resolved) {\n isBuild = resolved.command === \"build\";\n },\n async transform(code, id) {\n if (!(isBuild && isWasmEntry(id))) {\n return null;\n }\n if (!code.includes(ASSET_URL_BASE)) {\n this.error(\n `stll-anonymize-wasm: could not find the assetUrl base in ${id}. ` +\n \"The @stll/anonymize-wasm dist shape changed; update ASSET_URL_BASE \" +\n \"in the Vite plugin.\",\n );\n }\n const nativeDir = join(dirname(id), NATIVE_DIR);\n const files = await readdir(nativeDir);\n const selection = resolvePackageSelection(files, packages);\n if (selection.status === \"invalid\") {\n this.error(\n `stll-anonymize-wasm: invalid packages option ${JSON.stringify(selection.value)}; ` +\n `expected \"all\", \"none\", or an array like [\"default\", \"cs\"].`,\n );\n }\n if (selection.status === \"missing\") {\n this.error(\n `stll-anonymize-wasm: requested package(s) not bundled: ` +\n `${selection.names.join(\", \")}. Available: ${\n selection.available.join(\", \") || \"(none)\"\n }.`,\n );\n }\n let anchorRef: string | undefined;\n for (const file of files) {\n if (isPackageFile(file) && !selection.emit.has(file)) {\n continue;\n }\n const referenceId = this.emitFile({\n type: \"asset\",\n fileName: `${NATIVE_DIR}/${file}`,\n source: await readFile(join(nativeDir, file)),\n });\n if (file === ANCHOR_FILE) {\n anchorRef = referenceId;\n }\n }\n if (anchorRef === undefined) {\n this.error(\n `stll-anonymize-wasm: ${ANCHOR_FILE} is missing from ${nativeDir}; ` +\n \"cannot anchor the native asset base.\",\n );\n }\n return {\n code: code.replace(\n ASSET_URL_BASE,\n `fileName, import.meta.ROLLUP_FILE_URL_${anchorRef}`,\n ),\n map: null,\n };\n },\n };\n}\n"],"mappings":";;;AAmCA,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB;AACzE,MAAM,aAAa;;;;AAInB,MAAM,cAAc;;;;AAIpB,MAAM,iBAAiB;;;AAIvB,MAAM,iBAAiB;AACvB,MAAM,iBAAiB;AACvB,MAAM,uBAAuB,GAAG,eAAe;;;AAG/C,MAAM,uBAAuB;AAoB7B,MAAM,eAAe,OACnB,GAAG,SAAS,gBAAgB,KAAK,SAAS,EAAE,MAAM;AAEpD,MAAM,iBAAiB,SAA0B,KAAK,SAAS,cAAc;;AAG7E,MAAM,mBAAmB,SACvB,SAAS,uBACL,uBACA,GAAG,iBAAiB,OAAO;;;AASjC,MAAM,2BACJ,aACA,aACqB;CACrB,MAAM,eAAe,YAAY,OAAO,aAAa;CACrD,IAAI,aAAa,OACf,OAAO;EAAE,QAAQ;EAAM,MAAM,IAAI,IAAI,YAAY;CAAE;CAErD,IAAI,aAAa,QACf,OAAO;EAAE,QAAQ;EAAM,sBAAM,IAAI,IAAI;CAAE;CAEzC,IAAI,CAAC,MAAM,QAAQ,QAAQ,GAEzB,OAAO;EAAE,QAAQ;EAAW,OAAO,OAAO,QAAQ;CAAE;CAEtD,MAAM,YAAY,IAAI,IAAI,YAAY;CACtC,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,UAAoB,CAAC;CAC3B,KAAK,MAAM,QAAQ,UAAU;EAC3B,MAAM,WAAW,gBAAgB,IAAI;EACrC,IAAI,UAAU,IAAI,QAAQ,GACxB,KAAK,IAAI,QAAQ;OAEjB,QAAQ,KAAK,IAAI;CAErB;CACA,IAAI,QAAQ,SAAS,GACnB,OAAO;EAAE,QAAQ;EAAW,OAAO;EAAS,WAAW;CAAa;CAEtE,OAAO;EAAE,QAAQ;EAAM;CAAK;AAC9B;AAEA,SAAwB,sBACtB,UAAsC,CAAC,GAC/B;CACR,MAAM,WAAW,QAAQ,YAAY;CACrC,IAAI,UAAU;CACd,OAAO;EACL,MAAM;EAEN,SAAS;GACP,OAAO,EAAE,cAAc,EAAE,SAAS,iBAAiB,EAAE;EACvD;EACA,eAAe,UAAU;GACvB,UAAU,SAAS,YAAY;EACjC;EACA,MAAM,UAAU,MAAM,IAAI;GACxB,IAAI,EAAE,WAAW,YAAY,EAAE,IAC7B,OAAO;GAET,IAAI,CAAC,KAAK,SAAS,cAAc,GAC/B,KAAK,MACH,4DAA4D,GAAG,yFAGjE;GAEF,MAAM,YAAY,KAAK,QAAQ,EAAE,GAAG,UAAU;GAC9C,MAAM,QAAQ,MAAM,QAAQ,SAAS;GACrC,MAAM,YAAY,wBAAwB,OAAO,QAAQ;GACzD,IAAI,UAAU,WAAW,WACvB,KAAK,MACH,gDAAgD,KAAK,UAAU,UAAU,KAAK,EAAE,8DAElF;GAEF,IAAI,UAAU,WAAW,WACvB,KAAK,MACH,0DACK,UAAU,MAAM,KAAK,IAAI,EAAE,eAC5B,UAAU,UAAU,KAAK,IAAI,KAAK,SACnC,EACL;GAEF,IAAI;GACJ,KAAK,MAAM,QAAQ,OAAO;IACxB,IAAI,cAAc,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,IAAI,GACjD;IAEF,MAAM,cAAc,KAAK,SAAS;KAChC,MAAM;KACN,UAAU,GAAG,WAAW,GAAG;KAC3B,QAAQ,MAAM,SAAS,KAAK,WAAW,IAAI,CAAC;IAC9C,CAAC;IACD,IAAI,SAAS,aACX,YAAY;GAEhB;GACA,IAAI,cAAc,KAAA,GAChB,KAAK,MACH,wBAAwB,YAAY,mBAAmB,UAAU,uCAEnE;GAEF,OAAO;IACL,MAAM,KAAK,QACT,gBACA,yCAAyC,WAC3C;IACA,KAAK;GACP;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"vite.mjs","names":[],"sources":["../../src/vite.ts"],"sourcesContent":["/* Vite plugin that wires up @stll/anonymize-wasm so its wasm binding and\n * prepared-package assets survive both Vite's dev pre-bundler and a production\n * `vite build`.\n *\n * The package loads its wasm-bindgen binding and bundled `.stlanonpkg` packages at\n * runtime from its own `native/` asset directory via\n * `new URL(\"./native/…\", import.meta.url)` (the wasm module, its ESM glue,\n * and the packages). The paths are computed at runtime, so neither\n * Vite's optimizer nor Rollup's static `new URL(…, import.meta.url)` handling\n * can follow them on their own.\n *\n * Dev (`vite serve`): the package is added to `optimizeDeps.exclude`, keeping\n * its original on-disk paths so the\n * relative URLs resolve next to the package's own files.\n *\n * Build (`vite build`): Rollup bundles `wasm.mjs` into a chunk, rewriting\n * `import.meta.url`, and never copies the `native/` files. This plugin emits\n * the wasm binary + glue as build assets under a stable `native/` subdir, emits\n * the selected `.stlanonpkg` prepared packages (see {@link\n * AnonymizeWasmPluginOptions.packages}), and re-anchors the package's\n * `assetUrl` base onto a Rollup file-URL reference, so the runtime URLs resolve\n * to the emitted assets from whatever chunk ends up referencing them. The\n * glue's own internal `new URL(…, import.meta.url)` reference to its `.wasm`\n * keeps working because the files are emitted side by side.\n *\n * The bundled prepared packages dominate the emitted size (the default\n * full-dictionary package alone is ~20 MB, plus per-language variants). An app\n * that only ever calls `loadPipeline` with its own package, or\n * `loadDefaultPipeline(language)` for a known subset of languages, can drop the\n * rest with the `packages` option instead of shipping every bundled package.\n */\nimport { readdir, readFile } from \"node:fs/promises\";\nimport { basename, dirname, join } from \"node:path\";\nimport type { Plugin } from \"vite\";\n\nconst OPTIMIZE_EXCLUDE = [\"@stll/anonymize-wasm\"];\nconst NATIVE_DIR = \"native\";\n/** The generated glue is always shipped in `native/`; any file there works as the\n * anchor. `new URL(fileName, <anchor>)` resolves to `native/<fileName>` because\n * URL resolution replaces the anchor's last path segment. */\nconst ANCHOR_FILE = \"index.js\";\n/** The exact `assetUrl` base expression emitted by the build (see wasm.ts).\n * Kept in sync with the compiled `wasm.mjs`; the transform fails loudly if the\n * dist shape drifts so this cannot silently ship broken asset paths. */\nconst ASSET_URL_BASE = \"`./${NATIVE_ASSET_DIR}/${fileName}`, import.meta.url\";\n\n/** Prepared packages are named `native-pipeline.stlanonpkg` (the full-dictionary\n * default) and `native-pipeline.<language>.stlanonpkg` (scoped variants). */\nconst PACKAGE_SUFFIX = \".stlanonpkg\";\nconst PACKAGE_PREFIX = \"native-pipeline.\";\nconst DEFAULT_PACKAGE_FILE = `${PACKAGE_PREFIX}stlanonpkg`;\n/** Selection name for the full-dictionary default package. Every other name is\n * a language code that maps to `native-pipeline.<name>.stlanonpkg`. */\nconst DEFAULT_PACKAGE_NAME = \"default\";\n\n/** Which bundled `.stlanonpkg` prepared packages the plugin emits into a\n * production build. The wasm binary and glue are always emitted; only\n * the prepared packages are selectable because they dominate the output size.\n *\n * - `\"all\"` (default): every bundled package, preserving prior behavior.\n * - `\"none\"`: no prepared packages. The consumer must supply its own package to\n * `loadPipeline`; `loadDefaultPipeline()` then fails at runtime with a fetch\n * error because the asset was never emitted.\n * - a name list: only these packages. Use `\"default\"` for the full-dictionary\n * package and a language code (e.g. `\"cs\"`, `\"de\"`, `\"en\"`) for a scoped one,\n * for example `[\"cs\"]` or `[\"default\", \"en\"]`. A requested package that is\n * not bundled fails the build. */\nexport type AnonymizeWasmPackages = \"all\" | \"none\" | readonly string[];\n\nexport type AnonymizeWasmPluginOptions = {\n packages?: AnonymizeWasmPackages;\n};\n\nconst isWasmEntry = (id: string): boolean =>\n id.includes(\"anonymize-wasm\") && basename(id) === \"wasm.mjs\";\n\nconst isPackageFile = (file: string): boolean => file.endsWith(PACKAGE_SUFFIX);\n\n/** Map a selection name to its on-disk package file name. */\nconst packageFileName = (name: string): string =>\n name === DEFAULT_PACKAGE_NAME\n ? DEFAULT_PACKAGE_FILE\n : `${PACKAGE_PREFIX}${name}${PACKAGE_SUFFIX}`;\n\ntype PackageSelection =\n | { status: \"ok\"; emit: ReadonlySet<string> }\n | { status: \"missing\"; names: string[]; available: string[] }\n | { status: \"invalid\"; value: string };\n\n/** Resolve which prepared-package files to emit for the given selection,\n * validating that every explicitly requested name exists in `nativeFiles`. */\nconst resolvePackageSelection = (\n nativeFiles: readonly string[],\n packages: AnonymizeWasmPackages,\n): PackageSelection => {\n const packageFiles = nativeFiles.filter(isPackageFile);\n if (packages === \"all\") {\n return { status: \"ok\", emit: new Set(packageFiles) };\n }\n if (packages === \"none\") {\n return { status: \"ok\", emit: new Set() };\n }\n if (!Array.isArray(packages)) {\n // A bare string like \"cs\" would otherwise iterate per character below.\n return { status: \"invalid\", value: String(packages) };\n }\n const available = new Set(packageFiles);\n const emit = new Set<string>();\n const missing: string[] = [];\n for (const name of packages) {\n const fileName = packageFileName(name);\n if (available.has(fileName)) {\n emit.add(fileName);\n } else {\n missing.push(name);\n }\n }\n if (missing.length > 0) {\n return { status: \"missing\", names: missing, available: packageFiles };\n }\n return { status: \"ok\", emit };\n};\n\nexport default function stllAnonymizeWasmVite(\n options: AnonymizeWasmPluginOptions = {},\n): Plugin {\n const packages = options.packages ?? \"all\";\n let isBuild = false;\n return {\n name: \"stll-anonymize-wasm\",\n // optimizeDeps only affects dev; harmless (ignored) during build.\n config() {\n return { optimizeDeps: { exclude: OPTIMIZE_EXCLUDE } };\n },\n configResolved(resolved) {\n isBuild = resolved.command === \"build\";\n },\n async transform(code, id) {\n if (!(isBuild && isWasmEntry(id))) {\n return null;\n }\n if (!code.includes(ASSET_URL_BASE)) {\n this.error(\n `stll-anonymize-wasm: could not find the assetUrl base in ${id}. ` +\n \"The @stll/anonymize-wasm dist shape changed; update ASSET_URL_BASE \" +\n \"in the Vite plugin.\",\n );\n }\n const nativeDir = join(dirname(id), NATIVE_DIR);\n const files = await readdir(nativeDir);\n const selection = resolvePackageSelection(files, packages);\n if (selection.status === \"invalid\") {\n this.error(\n `stll-anonymize-wasm: invalid packages option ${JSON.stringify(selection.value)}; ` +\n `expected \"all\", \"none\", or an array like [\"default\", \"cs\"].`,\n );\n }\n if (selection.status === \"missing\") {\n this.error(\n `stll-anonymize-wasm: requested package(s) not bundled: ` +\n `${selection.names.join(\", \")}. Available: ${\n selection.available.join(\", \") || \"(none)\"\n }.`,\n );\n }\n let anchorRef: string | undefined;\n for (const file of files) {\n if (isPackageFile(file) && !selection.emit.has(file)) {\n continue;\n }\n const referenceId = this.emitFile({\n type: \"asset\",\n fileName: `${NATIVE_DIR}/${file}`,\n source: await readFile(join(nativeDir, file)),\n });\n if (file === ANCHOR_FILE) {\n anchorRef = referenceId;\n }\n }\n if (anchorRef === undefined) {\n this.error(\n `stll-anonymize-wasm: ${ANCHOR_FILE} is missing from ${nativeDir}; ` +\n \"cannot anchor the native asset base.\",\n );\n }\n return {\n code: code.replace(\n ASSET_URL_BASE,\n `fileName, import.meta.ROLLUP_FILE_URL_${anchorRef}`,\n ),\n map: null,\n };\n },\n };\n}\n"],"mappings":";;;AAmCA,MAAM,mBAAmB,CAAC,sBAAsB;AAChD,MAAM,aAAa;;;;AAInB,MAAM,cAAc;;;;AAIpB,MAAM,iBAAiB;;;AAIvB,MAAM,iBAAiB;AACvB,MAAM,iBAAiB;AACvB,MAAM,uBAAuB,GAAG,eAAe;;;AAG/C,MAAM,uBAAuB;AAoB7B,MAAM,eAAe,OACnB,GAAG,SAAS,gBAAgB,KAAK,SAAS,EAAE,MAAM;AAEpD,MAAM,iBAAiB,SAA0B,KAAK,SAAS,cAAc;;AAG7E,MAAM,mBAAmB,SACvB,SAAS,uBACL,uBACA,GAAG,iBAAiB,OAAO;;;AASjC,MAAM,2BACJ,aACA,aACqB;CACrB,MAAM,eAAe,YAAY,OAAO,aAAa;CACrD,IAAI,aAAa,OACf,OAAO;EAAE,QAAQ;EAAM,MAAM,IAAI,IAAI,YAAY;CAAE;CAErD,IAAI,aAAa,QACf,OAAO;EAAE,QAAQ;EAAM,sBAAM,IAAI,IAAI;CAAE;CAEzC,IAAI,CAAC,MAAM,QAAQ,QAAQ,GAEzB,OAAO;EAAE,QAAQ;EAAW,OAAO,OAAO,QAAQ;CAAE;CAEtD,MAAM,YAAY,IAAI,IAAI,YAAY;CACtC,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,UAAoB,CAAC;CAC3B,KAAK,MAAM,QAAQ,UAAU;EAC3B,MAAM,WAAW,gBAAgB,IAAI;EACrC,IAAI,UAAU,IAAI,QAAQ,GACxB,KAAK,IAAI,QAAQ;OAEjB,QAAQ,KAAK,IAAI;CAErB;CACA,IAAI,QAAQ,SAAS,GACnB,OAAO;EAAE,QAAQ;EAAW,OAAO;EAAS,WAAW;CAAa;CAEtE,OAAO;EAAE,QAAQ;EAAM;CAAK;AAC9B;AAEA,SAAwB,sBACtB,UAAsC,CAAC,GAC/B;CACR,MAAM,WAAW,QAAQ,YAAY;CACrC,IAAI,UAAU;CACd,OAAO;EACL,MAAM;EAEN,SAAS;GACP,OAAO,EAAE,cAAc,EAAE,SAAS,iBAAiB,EAAE;EACvD;EACA,eAAe,UAAU;GACvB,UAAU,SAAS,YAAY;EACjC;EACA,MAAM,UAAU,MAAM,IAAI;GACxB,IAAI,EAAE,WAAW,YAAY,EAAE,IAC7B,OAAO;GAET,IAAI,CAAC,KAAK,SAAS,cAAc,GAC/B,KAAK,MACH,4DAA4D,GAAG,yFAGjE;GAEF,MAAM,YAAY,KAAK,QAAQ,EAAE,GAAG,UAAU;GAC9C,MAAM,QAAQ,MAAM,QAAQ,SAAS;GACrC,MAAM,YAAY,wBAAwB,OAAO,QAAQ;GACzD,IAAI,UAAU,WAAW,WACvB,KAAK,MACH,gDAAgD,KAAK,UAAU,UAAU,KAAK,EAAE,8DAElF;GAEF,IAAI,UAAU,WAAW,WACvB,KAAK,MACH,0DACK,UAAU,MAAM,KAAK,IAAI,EAAE,eAC5B,UAAU,UAAU,KAAK,IAAI,KAAK,SACnC,EACL;GAEF,IAAI;GACJ,KAAK,MAAM,QAAQ,OAAO;IACxB,IAAI,cAAc,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,IAAI,GACjD;IAEF,MAAM,cAAc,KAAK,SAAS;KAChC,MAAM;KACN,UAAU,GAAG,WAAW,GAAG;KAC3B,QAAQ,MAAM,SAAS,KAAK,WAAW,IAAI,CAAC;IAC9C,CAAC;IACD,IAAI,SAAS,aACX,YAAY;GAEhB;GACA,IAAI,cAAc,KAAA,GAChB,KAAK,MACH,wBAAwB,YAAY,mBAAmB,UAAU,uCAEnE;GAEF,OAAO;IACL,MAAM,KAAK,QACT,gBACA,yCAAyC,WAC3C;IACA,KAAK;GACP;EACF;CACF;AACF"}
|
package/dist/wasm.d.mts
CHANGED
|
@@ -690,71 +690,79 @@ type NativeOpenSessionArchiveOptions = {
|
|
|
690
690
|
type NativePreparedRedactionSessionBinding = {
|
|
691
691
|
sessionId: () => string;
|
|
692
692
|
mappingCount: () => number;
|
|
693
|
-
restoreText
|
|
694
|
-
restoreTextAt
|
|
693
|
+
restoreText: (fullText: string) => string;
|
|
694
|
+
restoreTextAt: (fullText: string, observedAtEpochSeconds: number) => string;
|
|
695
695
|
toPlaintextJson: () => string;
|
|
696
|
-
toPlaintextJsonAt
|
|
697
|
-
toEncryptedArchive
|
|
698
|
-
toEncryptedArchiveAt
|
|
699
|
-
inspectJson
|
|
700
|
-
deleteJson
|
|
696
|
+
toPlaintextJsonAt: (observedAtEpochSeconds: number) => string;
|
|
697
|
+
toEncryptedArchive: (key: Uint8Array) => Uint8Array;
|
|
698
|
+
toEncryptedArchiveAt: (key: Uint8Array, observedAtEpochSeconds: number) => Uint8Array;
|
|
699
|
+
inspectJson: (observedAtEpochSeconds?: number) => string;
|
|
700
|
+
deleteJson: () => string;
|
|
701
701
|
redactStaticEntitiesJson: (fullText: string, operators?: NativeBindingOperatorConfig) => string;
|
|
702
|
-
redactStaticEntitiesJsonAt
|
|
703
|
-
planStaticEntitiesWithCallerDetections
|
|
702
|
+
redactStaticEntitiesJsonAt: (fullText: string, observedAtEpochSeconds: number, operators?: NativeBindingOperatorConfig) => string;
|
|
703
|
+
planStaticEntitiesWithCallerDetections: (options: NativeBindingSessionCallerRedactionPlanOptions) => NativePreparedSessionRedactionPlanBinding;
|
|
704
704
|
};
|
|
705
705
|
type NativePreparedSessionRedactionPlanBinding = {
|
|
706
706
|
resultJson: () => string;
|
|
707
707
|
commit: () => void;
|
|
708
708
|
};
|
|
709
709
|
type NativePreparedSearchBinding = {
|
|
710
|
-
prepareDiagnosticsJson
|
|
711
|
-
warmLazyRegex
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
restoreRedactionSession?: (plaintextJson: string) => NativePreparedRedactionSessionBinding;
|
|
718
|
-
restoreEncryptedRedactionSession?: (options: NativeBindingOpenSessionArchiveOptions) => NativePreparedRedactionSessionBinding;
|
|
710
|
+
prepareDiagnosticsJson: () => string;
|
|
711
|
+
warmLazyRegex: () => void;
|
|
712
|
+
warmLazyRegexDiagnosticsJson: () => string;
|
|
713
|
+
createRedactionSession: (sessionId: string) => NativePreparedRedactionSessionBinding;
|
|
714
|
+
createRedactionSessionWithLifecycle: (sessionId: string, createdAtEpochSeconds: number, expiresAtEpochSeconds?: number) => NativePreparedRedactionSessionBinding;
|
|
715
|
+
restoreRedactionSession: (plaintextJson: string) => NativePreparedRedactionSessionBinding;
|
|
716
|
+
restoreEncryptedRedactionSession: (options: NativeBindingOpenSessionArchiveOptions) => NativePreparedRedactionSessionBinding;
|
|
719
717
|
redactStaticEntities: (fullText: string, operators?: NativeBindingOperatorConfig) => NativeBindingStaticRedactionResult;
|
|
720
|
-
redactStaticEntitiesJson
|
|
721
|
-
redactStaticEntitiesWithCallerDetectionsJson
|
|
722
|
-
redactStaticEntitiesWithCallerDetectionsDiagnosticsJson
|
|
723
|
-
redactStaticEntitiesResultStreamJson
|
|
724
|
-
redactStaticEntitiesDiagnosticsJson
|
|
725
|
-
redactStaticEntitiesDiagnosticsStreamJson
|
|
726
|
-
redactStaticEntitiesSummaryDiagnosticsJson
|
|
718
|
+
redactStaticEntitiesJson: (fullText: string, operators?: NativeBindingOperatorConfig) => string;
|
|
719
|
+
redactStaticEntitiesWithCallerDetectionsJson: (fullText: string, options: NativeBindingCallerRedactionOptions) => string;
|
|
720
|
+
redactStaticEntitiesWithCallerDetectionsDiagnosticsJson: (fullText: string, options: NativeBindingCallerRedactionOptions) => string;
|
|
721
|
+
redactStaticEntitiesResultStreamJson: (fullText: string, operators: NativeBindingOperatorConfig | undefined, onEvent: NativeResultEventCallback) => string;
|
|
722
|
+
redactStaticEntitiesDiagnosticsJson: (fullText: string, operators?: NativeBindingOperatorConfig) => string;
|
|
723
|
+
redactStaticEntitiesDiagnosticsStreamJson: (fullText: string, operators: NativeBindingOperatorConfig | undefined, onBatch: NativeDiagnosticsBatchCallback) => string;
|
|
724
|
+
redactStaticEntitiesSummaryDiagnosticsJson: (fullText: string, operators?: NativeBindingOperatorConfig) => string;
|
|
727
725
|
};
|
|
728
726
|
type NativeAnonymizeBinding = {
|
|
729
|
-
convertExternalDetectionBatch
|
|
730
|
-
externalDetectionLimitsJson
|
|
731
|
-
extractDocxTextJson
|
|
732
|
-
inspectPdfJson
|
|
733
|
-
rewritePdfRasterFromDetectionsJson
|
|
727
|
+
convertExternalDetectionBatch: (document: Uint8Array, batchJson: string) => NativeCallerDetection[];
|
|
728
|
+
externalDetectionLimitsJson: () => string;
|
|
729
|
+
extractDocxTextJson: (document: Uint8Array) => string;
|
|
730
|
+
inspectPdfJson: (document: Uint8Array, observationsJson?: string) => string;
|
|
731
|
+
rewritePdfRasterFromDetectionsJson: (document: Uint8Array, requestJson: string, pagePixels: readonly Uint8Array[]) => {
|
|
734
732
|
document: Uint8Array;
|
|
735
733
|
certificateJson: string;
|
|
736
734
|
};
|
|
737
|
-
rewriteDocxTextNative
|
|
735
|
+
rewriteDocxTextNative: (document: Uint8Array, rewritesJson: string) => {
|
|
738
736
|
document: Uint8Array;
|
|
739
737
|
rewrittenBlockCount: number;
|
|
740
738
|
appliedReplacementCount: number;
|
|
741
739
|
};
|
|
742
|
-
planDocxRestorationJson
|
|
740
|
+
planDocxRestorationJson: (document: Uint8Array, sessionId: string) => string;
|
|
743
741
|
normalizeForSearch: (text: string) => string;
|
|
744
742
|
nativePackageVersion: () => string;
|
|
745
743
|
NativePreparedSearch: {
|
|
746
744
|
fromConfigJsonBytes: (configJson: Uint8Array) => NativePreparedSearchBinding;
|
|
747
745
|
fromPreparedPackageBytes: (packageBytes: Uint8Array) => NativePreparedSearchBinding;
|
|
748
|
-
fromPreparedPackageBytesWithoutCache
|
|
749
|
-
fromTrustedPreparedPackageBytes
|
|
750
|
-
fromTrustedPreparedPackageBytesWithoutCache
|
|
746
|
+
fromPreparedPackageBytesWithoutCache: (packageBytes: Uint8Array) => NativePreparedSearchBinding;
|
|
747
|
+
fromTrustedPreparedPackageBytes: (packageBytes: Uint8Array) => NativePreparedSearchBinding;
|
|
748
|
+
fromTrustedPreparedPackageBytesWithoutCache: (packageBytes: Uint8Array) => NativePreparedSearchBinding;
|
|
751
749
|
};
|
|
752
750
|
prepareStaticSearchPackageBytes: (configJson: Uint8Array) => Uint8Array;
|
|
753
751
|
prepareStaticSearchCompressedPackageBytes: (configJson: Uint8Array) => Uint8Array;
|
|
754
|
-
assembleStaticSearchConfigJson
|
|
755
|
-
assembleStaticSearchPackageBytes
|
|
756
|
-
assembleStaticSearchCompressedPackageBytes
|
|
757
|
-
};
|
|
752
|
+
assembleStaticSearchConfigJson: (pipelineConfigJson: Uint8Array, dictionariesJson?: Uint8Array, gazetteerJson?: Uint8Array) => Uint8Array;
|
|
753
|
+
assembleStaticSearchPackageBytes: (pipelineConfigJson: Uint8Array, dictionariesJson?: Uint8Array, gazetteerJson?: Uint8Array) => Uint8Array;
|
|
754
|
+
assembleStaticSearchCompressedPackageBytes: (pipelineConfigJson: Uint8Array, dictionariesJson?: Uint8Array, gazetteerJson?: Uint8Array) => Uint8Array;
|
|
755
|
+
};
|
|
756
|
+
/** Exhaustive runtime-member contract shared by loaders and parity gates. */
|
|
757
|
+
declare const NATIVE_BINDING_PARITY_MEMBERS: {
|
|
758
|
+
readonly root: readonly ["convertExternalDetectionBatch", "externalDetectionLimitsJson", "extractDocxTextJson", "inspectPdfJson", "rewritePdfRasterFromDetectionsJson", "rewriteDocxTextNative", "planDocxRestorationJson", "normalizeForSearch", "nativePackageVersion", "prepareStaticSearchPackageBytes", "prepareStaticSearchCompressedPackageBytes", "assembleStaticSearchConfigJson", "assembleStaticSearchPackageBytes", "assembleStaticSearchCompressedPackageBytes"];
|
|
759
|
+
readonly factories: readonly ["fromConfigJsonBytes", "fromPreparedPackageBytes", "fromPreparedPackageBytesWithoutCache", "fromTrustedPreparedPackageBytes", "fromTrustedPreparedPackageBytesWithoutCache"];
|
|
760
|
+
readonly prepared: readonly ["prepareDiagnosticsJson", "warmLazyRegex", "warmLazyRegexDiagnosticsJson", "createRedactionSession", "createRedactionSessionWithLifecycle", "restoreRedactionSession", "restoreEncryptedRedactionSession", "redactStaticEntities", "redactStaticEntitiesJson", "redactStaticEntitiesWithCallerDetectionsJson", "redactStaticEntitiesWithCallerDetectionsDiagnosticsJson", "redactStaticEntitiesResultStreamJson", "redactStaticEntitiesDiagnosticsJson", "redactStaticEntitiesDiagnosticsStreamJson", "redactStaticEntitiesSummaryDiagnosticsJson"];
|
|
761
|
+
readonly session: readonly ["sessionId", "mappingCount", "restoreText", "restoreTextAt", "toPlaintextJson", "toPlaintextJsonAt", "toEncryptedArchive", "toEncryptedArchiveAt", "inspectJson", "deleteJson", "redactStaticEntitiesJson", "redactStaticEntitiesJsonAt", "planStaticEntitiesWithCallerDetections"];
|
|
762
|
+
readonly plan: readonly ["resultJson", "commit"];
|
|
763
|
+
};
|
|
764
|
+
/** Validate the complete runtime-neutral root and factory binding shape. */
|
|
765
|
+
declare const isNativeAnonymizeBinding: (candidate: unknown) => candidate is NativeAnonymizeBinding;
|
|
758
766
|
type NativeOperatorConfig = {
|
|
759
767
|
operators?: Record<string, OperatorSelection>;
|
|
760
768
|
redactString?: string;
|
|
@@ -940,12 +948,12 @@ declare class PreparedNativeSessionRedactionPlan {
|
|
|
940
948
|
declare class PreparedNativeAnonymizer {
|
|
941
949
|
#private;
|
|
942
950
|
constructor(prepared: NativePreparedSearchBinding);
|
|
943
|
-
prepareDiagnosticsJson(): string
|
|
944
|
-
prepare_diagnostics_json(): string
|
|
951
|
+
prepareDiagnosticsJson(): string;
|
|
952
|
+
prepare_diagnostics_json(): string;
|
|
945
953
|
warmLazyRegex(): void;
|
|
946
954
|
warm_lazy_regex(): void;
|
|
947
|
-
warmLazyRegexDiagnosticsJson(): string
|
|
948
|
-
warm_lazy_regex_diagnostics_json(): string
|
|
955
|
+
warmLazyRegexDiagnosticsJson(): string;
|
|
956
|
+
warm_lazy_regex_diagnostics_json(): string;
|
|
949
957
|
createRedactionSession(sessionId: string): PreparedNativeRedactionSession;
|
|
950
958
|
create_redaction_session(sessionId: string): PreparedNativeRedactionSession;
|
|
951
959
|
createRedactionSessionWithLifecycle({ sessionId, createdAtEpochSeconds, expiresAtEpochSeconds }: NativeCreateSessionWithLifecycleOptions): PreparedNativeRedactionSession;
|
|
@@ -959,27 +967,27 @@ declare class PreparedNativeAnonymizer {
|
|
|
959
967
|
redact_text_json(fullText: string, operators?: NativeOperatorConfig): string;
|
|
960
968
|
redactStaticEntitiesWithCallerDetections(fullText: string, options: NativeCallerRedactionOptions): NativeStaticRedactionResult;
|
|
961
969
|
redact_text_with_caller_detections(fullText: string, options: NativeCallerRedactionOptions): NativeStaticRedactionResult;
|
|
962
|
-
redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(fullText: string, options: NativeCallerRedactionOptions): string
|
|
963
|
-
redact_static_entities_with_caller_detections_diagnostics_json(fullText: string, options: NativeCallerRedactionOptions): string
|
|
970
|
+
redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(fullText: string, options: NativeCallerRedactionOptions): string;
|
|
971
|
+
redact_static_entities_with_caller_detections_diagnostics_json(fullText: string, options: NativeCallerRedactionOptions): string;
|
|
964
972
|
redactTextJson(fullText: string, operators?: NativeOperatorConfig): string;
|
|
965
|
-
redactTextStreamJson(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string
|
|
966
|
-
redact_text_stream_json(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string
|
|
967
|
-
redactStaticEntitiesDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string
|
|
968
|
-
diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string
|
|
969
|
-
diagnosticsStreamJson(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string
|
|
970
|
-
diagnostics_stream_json(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string
|
|
971
|
-
redactStaticEntitiesSummaryDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string
|
|
972
|
-
summary_diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string
|
|
973
|
+
redactTextStreamJson(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string;
|
|
974
|
+
redact_text_stream_json(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string;
|
|
975
|
+
redactStaticEntitiesDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string;
|
|
976
|
+
diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string;
|
|
977
|
+
diagnosticsStreamJson(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string;
|
|
978
|
+
diagnostics_stream_json(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string;
|
|
979
|
+
redactStaticEntitiesSummaryDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string;
|
|
980
|
+
summary_diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string;
|
|
973
981
|
}
|
|
974
982
|
declare class PreparedNativePipeline {
|
|
975
983
|
#private;
|
|
976
984
|
constructor(anonymizer: PreparedNativeAnonymizer);
|
|
977
|
-
prepareDiagnosticsJson(): string
|
|
978
|
-
prepare_diagnostics_json(): string
|
|
985
|
+
prepareDiagnosticsJson(): string;
|
|
986
|
+
prepare_diagnostics_json(): string;
|
|
979
987
|
warmLazyRegex(): void;
|
|
980
988
|
warm_lazy_regex(): void;
|
|
981
|
-
warmLazyRegexDiagnosticsJson(): string
|
|
982
|
-
warm_lazy_regex_diagnostics_json(): string
|
|
989
|
+
warmLazyRegexDiagnosticsJson(): string;
|
|
990
|
+
warm_lazy_regex_diagnostics_json(): string;
|
|
983
991
|
createRedactionSession(sessionId: string): PreparedNativeRedactionSession;
|
|
984
992
|
create_redaction_session(sessionId: string): PreparedNativeRedactionSession;
|
|
985
993
|
createRedactionSessionWithLifecycle(options: NativeCreateSessionWithLifecycleOptions): PreparedNativeRedactionSession;
|
|
@@ -993,17 +1001,17 @@ declare class PreparedNativePipeline {
|
|
|
993
1001
|
redact_text_json(fullText: string, operators?: NativeOperatorConfig): string;
|
|
994
1002
|
redactTextWithCallerDetections(fullText: string, options: NativeCallerRedactionOptions): NativeStaticRedactionResult;
|
|
995
1003
|
redact_text_with_caller_detections(fullText: string, options: NativeCallerRedactionOptions): NativeStaticRedactionResult;
|
|
996
|
-
redactTextWithCallerDetectionsDiagnosticsJson(fullText: string, options: NativeCallerRedactionOptions): string
|
|
997
|
-
redact_text_with_caller_detections_diagnostics_json(fullText: string, options: NativeCallerRedactionOptions): string
|
|
1004
|
+
redactTextWithCallerDetectionsDiagnosticsJson(fullText: string, options: NativeCallerRedactionOptions): string;
|
|
1005
|
+
redact_text_with_caller_detections_diagnostics_json(fullText: string, options: NativeCallerRedactionOptions): string;
|
|
998
1006
|
redactTextJson(fullText: string, operators?: NativeOperatorConfig): string;
|
|
999
|
-
redactTextStreamJson(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string
|
|
1000
|
-
redact_text_stream_json(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string
|
|
1001
|
-
redactTextDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string
|
|
1002
|
-
diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string
|
|
1003
|
-
diagnosticsStreamJson(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string
|
|
1004
|
-
diagnostics_stream_json(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string
|
|
1005
|
-
redactTextSummaryDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string
|
|
1006
|
-
summary_diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string
|
|
1007
|
+
redactTextStreamJson(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string;
|
|
1008
|
+
redact_text_stream_json(fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig): string;
|
|
1009
|
+
redactTextDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string;
|
|
1010
|
+
diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string;
|
|
1011
|
+
diagnosticsStreamJson(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string;
|
|
1012
|
+
diagnostics_stream_json(fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig): string;
|
|
1013
|
+
redactTextSummaryDiagnosticsJson(fullText: string, operators?: NativeOperatorConfig): string;
|
|
1014
|
+
summary_diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string;
|
|
1007
1015
|
}
|
|
1008
1016
|
declare const encodeNativeSearchConfig: (config: NativePreparedSearchConfig) => Uint8Array;
|
|
1009
1017
|
declare const encodeNativeSearchConfigInput: (config: NativeSearchPackageInput) => Uint8Array;
|
|
@@ -1118,13 +1126,13 @@ type PrepareSearchPackageOptions = WasmBindingOptions & {
|
|
|
1118
1126
|
declare const prepare_search_package: (config: NativeSearchPackageInput, { compressed, ...options }?: PrepareSearchPackageOptions) => Promise<Uint8Array>;
|
|
1119
1127
|
declare const redact_text: (config: NativeSearchPackageInput, fullText: string, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<NativeStaticRedactionResult>;
|
|
1120
1128
|
declare const redact_text_json: (config: NativeSearchPackageInput, fullText: string, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string>;
|
|
1121
|
-
declare const redact_text_stream_json: (config: NativeSearchPackageInput, fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string
|
|
1122
|
-
declare const diagnostics_json: (config: NativeSearchPackageInput, fullText: string, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string
|
|
1123
|
-
declare const diagnostics_stream_json: (config: NativeSearchPackageInput, fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string
|
|
1124
|
-
declare const summary_diagnostics_json: (config: NativeSearchPackageInput, fullText: string, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string
|
|
1129
|
+
declare const redact_text_stream_json: (config: NativeSearchPackageInput, fullText: string, onEvent: NativeResultEventCallback, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string>;
|
|
1130
|
+
declare const diagnostics_json: (config: NativeSearchPackageInput, fullText: string, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string>;
|
|
1131
|
+
declare const diagnostics_stream_json: (config: NativeSearchPackageInput, fullText: string, onBatch: NativeDiagnosticsBatchCallback, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string>;
|
|
1132
|
+
declare const summary_diagnostics_json: (config: NativeSearchPackageInput, fullText: string, operators?: NativeOperatorConfig, options?: WasmBindingOptions) => Promise<string>;
|
|
1125
1133
|
/** Inspect PDF bytes and optional renderer observations through the same
|
|
1126
1134
|
* fail-closed core used by Node and Python. This does not redact the PDF. */
|
|
1127
1135
|
declare const inspect_pdf_json: (document: Uint8Array, observationsJson?: string, options?: WasmBindingOptions) => Promise<string>;
|
|
1128
1136
|
//#endregion
|
|
1129
|
-
export { type AnonymisationOperator, CALLER_DETECTION_CONTRACT_VERSION, CAPABILITY_MANIFEST, CAPABILITY_MANIFEST_SCHEMA_VERSION, CAPABILITY_PARITY_PROFILES, CAPABILITY_RUNTIMES, CAPABILITY_SURFACES, type CapabilityManifest, type CapabilityParityProfile, type CapabilityRuntime, type CapabilitySurface, type CapabilitySurfaceId, ConvertExternalDetectionBatchOptions, DEFAULT_ENTITY_LABELS, DETECTION_SOURCES, DETECTOR_PRIORITY, type DefaultEntityLabel, type DetectionSource, type Dictionaries, ENTITY_CAPABILITIES, ENTITY_LABELS, ENTITY_SELECTIONS, EXTERNAL_DETECTION_BATCH_MAX_BYTES, EXTERNAL_DETECTION_BATCH_VERSION, EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, EXTERNAL_DETECTION_MAX_DETECTIONS, EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, EXTERNAL_DETECTION_MAX_METADATA_BYTES, EXTERNAL_DETECTION_OFFSET_UNITS, EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, type Entity, type EntityCapability, type EntityLabel, type EntitySelection, ExternalDetectionBatch, ExternalDetectionOffsetUnit, type GazetteerEntry, LoadPreparedPackageOptions, NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeCallerDetection, NativeCallerRedactionOptions, NativeCreateSessionWithLifecycleOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOpenSessionArchiveOptions, NativeOperatorConfig, type NativePipelineBuildOptions, type NativePipelineCompatibility, NativePipelineEntity, NativePipelineFromPackageOptions, type NativePipelinePackageOptions, type NativePipelineUnsupportedFeature, NativePreparedRedactionSessionBinding, NativePreparedSearchBinding, type NativePreparedSearchConfig, NativePreparedSessionRedactionPlanBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeSessionBlockRedactionPlan, NativeSessionCallerRedactionInput, NativeSessionCallerRedactionPlanOptions, NativeSessionDeletionSummary, NativeSessionLifecycle, NativeSessionMetadata, NativeSessionRedactionAtOptions, NativeSessionStatus, NativeStaticRedactionResult, NativeTextReplacement, OPERATOR_TYPES, type OperatorConfig, type OperatorType, type PipelineConfig, type PipelineContext, PrepareSearchPackageOptions, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedPackageSource, PreparedSearch, type RedactionResult, type ReviewDecision, type ReviewedEntity, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, WasmBindingOptions, assertNativeBindingVersion, assertNativePipelineSupported, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromConfig, createNativePipelineFromPackage, createPipelineContext, deanonymise, defaultPackageUrl, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, exportRedactionKey, getBinding, getDefaultPipeline, getNativeBindingVersion, getNativePipelineCompatibility, inspect_pdf_json, loadDefaultPipeline, loadPipeline, load_prepared_package, native_package_version, normalize_for_search, prepareNativePipelineConfig, prepareNativePipelinePackage, prepareNativeSearchPackage, prepare_search_package, redactDefaultText, redactDefaultTextJson, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
1137
|
+
export { type AnonymisationOperator, CALLER_DETECTION_CONTRACT_VERSION, CAPABILITY_MANIFEST, CAPABILITY_MANIFEST_SCHEMA_VERSION, CAPABILITY_PARITY_PROFILES, CAPABILITY_RUNTIMES, CAPABILITY_SURFACES, type CapabilityManifest, type CapabilityParityProfile, type CapabilityRuntime, type CapabilitySurface, type CapabilitySurfaceId, ConvertExternalDetectionBatchOptions, DEFAULT_ENTITY_LABELS, DETECTION_SOURCES, DETECTOR_PRIORITY, type DefaultEntityLabel, type DetectionSource, type Dictionaries, ENTITY_CAPABILITIES, ENTITY_LABELS, ENTITY_SELECTIONS, EXTERNAL_DETECTION_BATCH_MAX_BYTES, EXTERNAL_DETECTION_BATCH_VERSION, EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, EXTERNAL_DETECTION_MAX_DETECTIONS, EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, EXTERNAL_DETECTION_MAX_METADATA_BYTES, EXTERNAL_DETECTION_OFFSET_UNITS, EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, type Entity, type EntityCapability, type EntityLabel, type EntitySelection, ExternalDetectionBatch, ExternalDetectionOffsetUnit, type GazetteerEntry, LoadPreparedPackageOptions, NATIVE_BINDING_PARITY_MEMBERS, NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeCallerDetection, NativeCallerRedactionOptions, NativeCreateSessionWithLifecycleOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOpenSessionArchiveOptions, NativeOperatorConfig, type NativePipelineBuildOptions, type NativePipelineCompatibility, NativePipelineEntity, NativePipelineFromPackageOptions, type NativePipelinePackageOptions, type NativePipelineUnsupportedFeature, NativePreparedRedactionSessionBinding, NativePreparedSearchBinding, type NativePreparedSearchConfig, NativePreparedSessionRedactionPlanBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeSessionBlockRedactionPlan, NativeSessionCallerRedactionInput, NativeSessionCallerRedactionPlanOptions, NativeSessionDeletionSummary, NativeSessionLifecycle, NativeSessionMetadata, NativeSessionRedactionAtOptions, NativeSessionStatus, NativeStaticRedactionResult, NativeTextReplacement, OPERATOR_TYPES, type OperatorConfig, type OperatorType, type PipelineConfig, type PipelineContext, PrepareSearchPackageOptions, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedPackageSource, PreparedSearch, type RedactionResult, type ReviewDecision, type ReviewedEntity, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, WasmBindingOptions, assertNativeBindingVersion, assertNativePipelineSupported, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromConfig, createNativePipelineFromPackage, createPipelineContext, deanonymise, defaultPackageUrl, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, exportRedactionKey, getBinding, getDefaultPipeline, getNativeBindingVersion, getNativePipelineCompatibility, inspect_pdf_json, isNativeAnonymizeBinding, loadDefaultPipeline, loadPipeline, load_prepared_package, native_package_version, normalize_for_search, prepareNativePipelineConfig, prepareNativePipelinePackage, prepareNativeSearchPackage, prepare_search_package, redactDefaultText, redactDefaultTextJson, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
1130
1138
|
//# sourceMappingURL=wasm.d.mts.map
|