tracker: better documentation for sanitizer properties
This commit is contained in:
parent
4a97094c0e
commit
1efe57797c
2 changed files with 38 additions and 1 deletions
|
|
@ -9,8 +9,28 @@ export enum SanitizeLevel {
|
|||
}
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Sanitize emails in text DOM nodes
|
||||
*
|
||||
* (for inputs, look for obscureInputEmails)
|
||||
* */
|
||||
obscureTextEmails: boolean
|
||||
/**
|
||||
* Sanitize emails in text DOM nodes
|
||||
*
|
||||
* (for inputs, look for obscureInputNumbers)
|
||||
* */
|
||||
obscureTextNumbers: boolean
|
||||
/**
|
||||
* Sanitize the DOM node based on the returned level
|
||||
* (Plain = 0, Obscured = 1, Hidden = 2)
|
||||
*
|
||||
* higher security levels will override other settings or data-params.
|
||||
*
|
||||
* @param node - the DOM node to sanitize
|
||||
* @returns the level of sanitization to apply
|
||||
*
|
||||
* */
|
||||
domSanitizer?: (node: Element) => SanitizeLevel
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,10 +91,27 @@ export const InputMode = {
|
|||
export type InputModeT = (typeof InputMode)[keyof typeof InputMode]
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Sanitize numbers from DOM input nodes.
|
||||
*
|
||||
* (for plain text nodes, look for obscureTextNumbers)
|
||||
* */
|
||||
obscureInputNumbers: boolean
|
||||
/**
|
||||
* Sanitize emails from DOM input nodes.
|
||||
*
|
||||
* (for plain text nodes, look for obscureTextEmails)
|
||||
* */
|
||||
obscureInputEmails: boolean
|
||||
defaultInputMode: InputModeT
|
||||
/**
|
||||
* Sanitize dates from DOM input nodes.
|
||||
* */
|
||||
obscureInputDates: boolean
|
||||
/**
|
||||
* Default input mode for all input nodes. Higher security level
|
||||
* will override other settings.
|
||||
* */
|
||||
defaultInputMode: InputModeT
|
||||
}
|
||||
|
||||
export default function (app: App, opts: Partial<Options>): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue