//#region src/constants.d.ts /** * Runtime-free constants for the anonymization pipeline. * * This module is the SSR-safe / browser-safe entrypoint: * importing it must not pull in `@stll/anonymize-wasm` * or any other runtime-bearing module. * Consumers that only need the static label list, * detection-source identifiers, or operator names import * from `@stll/anonymize/constants` (or * `@stll/anonymize-wasm/constants`) without paying the * wasm / regex-set startup cost. * * `types.ts` re-exports these for back-compat, so existing * `import { DEFAULT_ENTITY_LABELS } from "@stll/anonymize"` * call sites keep working. */ /** * Source of a detected entity span. * Ordered by detection layer in the pipeline. */ declare const DETECTION_SOURCES: { readonly TRIGGER: "trigger"; readonly REGEX: "regex"; readonly DENY_LIST: "deny-list"; readonly LEGAL_FORM: "legal-form"; readonly GAZETTEER: "gazetteer"; readonly COUNTRY: "country"; readonly NER: "ner"; readonly COREFERENCE: "coreference"; }; type DetectionSource = (typeof DETECTION_SOURCES)[keyof typeof DETECTION_SOURCES]; /** * Priority levels for detection sources. * Higher = more structurally reliable. Used during * overlap resolution so deterministic detectors beat * probabilistic ones regardless of raw score. */ declare const DETECTOR_PRIORITY: { readonly gazetteer: 5; readonly trigger: 4; readonly "legal-form": 3; readonly regex: 3; readonly country: 3; readonly "deny-list": 2; readonly coreference: 2; readonly ner: 1; }; /** * Anonymization operator types. Each operator defines * how a confirmed entity is replaced in the output. */ declare const OPERATOR_TYPES: readonly ["replace", "redact", "keep", "mask"]; type OperatorType = (typeof OPERATOR_TYPES)[number]; declare const ENTITY_SELECTIONS: { readonly DEFAULT: "default"; readonly OPT_IN: "opt-in"; }; type EntitySelection = (typeof ENTITY_SELECTIONS)[keyof typeof ENTITY_SELECTIONS]; type EntityCapability = { label: string; selection: EntitySelection; detectionSources: readonly DetectionSource[]; }; /** * Canonical entity capabilities exposed by the deterministic native pipeline. * `selection` describes whether the default package requests the label; opt-in * labels have built-in detection rules but must be requested explicitly. * * These labels are ephemeral: entities are regenerated on * every pipeline run and never persisted to the database. * Renaming a label here requires no migration. */ declare const ENTITY_CAPABILITIES: readonly [{ readonly label: "person"; readonly selection: "default"; readonly detectionSources: readonly ["trigger", "regex", "deny-list", "coreference"]; }, { readonly label: "organization"; readonly selection: "default"; readonly detectionSources: readonly ["trigger", "deny-list", "legal-form", "gazetteer", "coreference"]; }, { readonly label: "phone number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "address"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger", "deny-list"]; }, { readonly label: "country"; readonly selection: "default"; readonly detectionSources: readonly ["country"]; }, { readonly label: "email address"; readonly selection: "default"; readonly detectionSources: readonly ["regex"]; }, { readonly label: "date"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "date of birth"; readonly selection: "default"; readonly detectionSources: readonly ["trigger"]; }, { readonly label: "bank account number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "iban"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "tax identification number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "identity card number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "birth number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "national identification number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "social security number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "registration number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "case number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "credit card number"; readonly selection: "default"; readonly detectionSources: readonly ["regex"]; }, { readonly label: "passport number"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "crypto"; readonly selection: "default"; readonly detectionSources: readonly ["regex"]; }, { readonly label: "monetary amount"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "trigger"]; }, { readonly label: "land parcel"; readonly selection: "default"; readonly detectionSources: readonly ["trigger"]; }, { readonly label: "misc"; readonly selection: "default"; readonly detectionSources: readonly ["regex", "deny-list"]; }, { readonly label: "ip address"; readonly selection: "opt-in"; readonly detectionSources: readonly ["regex"]; }, { readonly label: "mac address"; readonly selection: "opt-in"; readonly detectionSources: readonly ["regex"]; }, { readonly label: "url"; readonly selection: "opt-in"; readonly detectionSources: readonly ["regex"]; }]; type KnownEntityCapability = (typeof ENTITY_CAPABILITIES)[number]; type EntityLabel = KnownEntityCapability["label"]; declare const ENTITY_LABELS: readonly EntityLabel[]; type DefaultEntityLabel = Extract["label"]; declare const DEFAULT_ENTITY_LABELS: readonly DefaultEntityLabel[]; //#endregion export { DetectionSource as a, ENTITY_SELECTIONS as c, EntitySelection as d, OPERATOR_TYPES as f, DefaultEntityLabel as i, EntityCapability as l, DETECTION_SOURCES as n, ENTITY_CAPABILITIES as o, OperatorType as p, DETECTOR_PRIORITY as r, ENTITY_LABELS as s, DEFAULT_ENTITY_LABELS as t, EntityLabel as u }; //# sourceMappingURL=constants2.d.mts.map