type: update type any => node (#46716)

* docs: update publish Date

* type: update type any => node
This commit is contained in:
lijianan 2023-12-31 23:51:31 +08:00 committed by GitHub
parent 24b083e8aa
commit 235fb6576c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ export const BaseSize = 2;
export const FontGap = 3;
// Prevent external hidden elements from adding accent styles
const EmphasizedStyles = {
const emphasizedStyle = {
visibility: 'visible !important',
};
@ -44,7 +44,7 @@ export default function useWatermark(
...markStyle,
backgroundImage: `url('${base64Url}')`,
backgroundSize: `${Math.floor(markWidth)}px`,
...(EmphasizedStyles as React.CSSProperties),
...(emphasizedStyle as React.CSSProperties),
}),
);
// Prevents using the browser `Hide Element` to hide watermarks

View File

@ -15,11 +15,11 @@ export function getPixelRatio() {
}
/** Whether to re-render the watermark */
export const reRendering = (mutation: MutationRecord, isWatermarkEle: (ele: any) => boolean) => {
export const reRendering = (mutation: MutationRecord, isWatermarkEle: (ele: Node) => boolean) => {
let flag = false;
// Whether to delete the watermark node
if (mutation.removedNodes.length) {
flag = Array.from(mutation.removedNodes).some((node) => isWatermarkEle(node));
flag = Array.from<Node>(mutation.removedNodes).some((node) => isWatermarkEle(node));
}
// Whether the watermark dom property value has been modified
if (mutation.type === 'attributes' && isWatermarkEle(mutation.target)) {