Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Commit 012a011

Browse files
author
Andy Meerwaldt
committed
Declare the window object as a type with the specific links
1 parent f0edfb4 commit 012a011

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/schema-blocks/src/functions/gutenberg/watchers/warningWatcher.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ enum WarningType {
1616
BLOCK_RECOMMENDED
1717
}
1818

19+
type yoastLinks = {
20+
yoastSchemaBlocks: {
21+
requiredLink: string;
22+
recommendedLink: string;
23+
};
24+
}
25+
1926
/**
2027
* Gets the inner blocks instruction of the block definition with the given name.
2128
*
@@ -55,7 +62,7 @@ function getDefaultWarningMessage( blockTitle: string, warningType: WarningType
5562
"yoast-schema-blocks",
5663
),
5764
blockTitle,
58-
'<a href="' + ( window as any ).yoastSchemaBlocks.requiredLink + '" target="_blank">',
65+
'<a href="' + ( window as unknown as yoastLinks ).yoastSchemaBlocks.requiredLink + '" target="_blank">',
5966
"</a>",
6067
);
6168
}
@@ -68,7 +75,7 @@ function getDefaultWarningMessage( blockTitle: string, warningType: WarningType
6875
"yoast-schema-blocks",
6976
),
7077
blockTitle,
71-
'<a href="' + ( window as any ).yoastSchemaBlocks.recommendedLink + '" target="_blank">',
78+
'<a href="' + ( window as unknown as yoastLinks ).yoastSchemaBlocks.recommendedLink + '" target="_blank">',
7279
"</a>",
7380
);
7481
}

0 commit comments

Comments
 (0)