You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the error "Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'" when adding the afterNavigate function as per documentation for sveltekit
Steps to Reproduce
Create new sveltekit project as per docs.
Add afterNavigate function HSStatic
Demo Link
Expected Behavior
There should be no error
Actual Behavior
Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'
Screenshots
No response
The text was updated successfully, but these errors were encountered:
Getting the error "Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'" when adding the afterNavigate function as per documentation for sveltekit
Steps to Reproduce
Create new sveltekit project as per docs.
Add afterNavigate function HSStatic
Demo Link
Expected Behavior
There should be no error
Actual Behavior
Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'
Screenshots
No response
Hi,
For now you can declare static methods in a file. We'll add it globally in future versions.
import { IStaticMethods } from 'preline/src/static/interfaces';
declare global {
interface Window {
HSStaticMethods: IStaticMethods;
}
}
Getting the error "Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'" when adding the afterNavigate function as per documentation for sveltekit
Steps to Reproduce
Create new sveltekit project as per docs.
Add afterNavigate function HSStatic
Demo Link
Expected Behavior
There should be no error
Actual Behavior
Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'
Screenshots
No response
Hi, For now you can declare static methods in a file. We'll add it globally in future versions.
import { IStaticMethods } from 'preline/src/static/interfaces';
declare global {
interface Window {
HSStaticMethods: IStaticMethods;
}
}
You comment is timely as I also had a similar issue. Thank you.
However, on implemantation, I did not know where to declare it (just getting started with Sveltekit). So, I gathered that this should be done in a global.d.ts or index.d.ts file (I prefered setting it up within the src folder). I found further reading on it here, check it out in case you need more infor on it:
Summary
Getting the error "Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'" when adding the afterNavigate function as per documentation for sveltekit
Steps to Reproduce
Demo Link
Expected Behavior
There should be no error
Actual Behavior
Property 'HSStaticMethods' does not exist on type 'Window & typeof globalThis'
Screenshots
No response
The text was updated successfully, but these errors were encountered: