|
|
@@ -1,7 +1,14 @@
|
|
|
+import { defaultSchema as sanitizeDefaultSchema } from 'rehype-sanitize';
|
|
|
+import type { RehypeSanitizeOption } from '~/interfaces/rehype';
|
|
|
+
|
|
|
+type tagWhiteList = typeof sanitizeDefaultSchema.tagNames;
|
|
|
+type attrWhiteList = typeof sanitizeDefaultSchema.attributes;
|
|
|
+
|
|
|
export type XssOptionConfig = {
|
|
|
isEnabledXssPrevention: boolean,
|
|
|
- tagWhiteList: any[],
|
|
|
- attrWhiteList: any[],
|
|
|
+ xssOption: RehypeSanitizeOption,
|
|
|
+ tagWhiteList: tagWhiteList,
|
|
|
+ attrWhiteList: attrWhiteList,
|
|
|
}
|
|
|
|
|
|
export default class XssOption {
|