File tree Expand file tree Collapse file tree 1 file changed +31
-4
lines changed Expand file tree Collapse file tree 1 file changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ async function moduleFromPath(path: string): Promise<WebAssembly.Module> {
2929 throw new Error ( `Unknown path: ${ path } ` ) ;
3030}
3131
32+ /**
33+ * Initialize the WebAssembly.
34+ *
35+ * @param detect
36+ * Custom detection function.
37+ * @param replace
38+ * Custom replacement function.
39+ * @returns
40+ * Promise to the initialized WebAssembly instance.
41+ */
3242export async function initializeWasm (
3343 detect : CustomDetect ,
3444 replace : CustomRedact ,
@@ -48,12 +58,29 @@ export async function initializeWasm(
4858 }
4959}
5060
51- type CustomDetect = typeof ArcjetRedactCustomRedact . detectSensitiveInfo ;
52- type CustomRedact = typeof ArcjetRedactCustomRedact . redactSensitiveInfo ;
61+ /**
62+ * Detect sensitive info.
63+ *
64+ * @param tokens
65+ * Tokens to detect in.
66+ * @returns
67+ * Array of detected entities.
68+ */
69+ export type CustomDetect = typeof ArcjetRedactCustomRedact . detectSensitiveInfo ;
70+
71+ /**
72+ * Redact sensitive info.
73+ *
74+ * @param entityType
75+ * Entity to redact.
76+ * @param plaintext
77+ * The plaintext string to redact.
78+ * @returns
79+ * Redacted string.
80+ */
81+ export type CustomRedact = typeof ArcjetRedactCustomRedact . redactSensitiveInfo ;
5382
5483export {
55- type CustomDetect ,
56- type CustomRedact ,
5784 type RedactedSensitiveInfoEntity ,
5885 type RedactSensitiveInfoConfig ,
5986 type SensitiveInfoEntity ,
You can’t perform that action at this time.
0 commit comments