fix: Add WNW_CONFIG type definitions and fix TypeScript errors

This commit is contained in:
dwindown
2025-11-05 12:05:29 +07:00
parent af3ae9d1fb
commit 855f3fcae5
3 changed files with 34 additions and 6 deletions

View File

@@ -16,11 +16,39 @@ interface WNW_WC_MENUS {
items?: any[];
}
interface WNW_CONFIG {
standaloneMode?: boolean;
restUrl?: string;
wpAdminUrl?: string;
siteUrl?: string;
siteName?: string;
isAuthenticated?: boolean;
currentUser?: {
id: number;
name: string;
email: string;
};
user?: {
id: number;
name: string;
email: string;
};
store?: {
currency: string;
currencySymbol: string;
currencyPosition: string;
thousandSeparator: string;
decimalSeparator: string;
decimals: number;
};
}
declare global {
interface Window {
WNW_API?: WNW_API_Config;
wnw?: WNW_Config;
WNW_WC_MENUS?: WNW_WC_MENUS;
WNW_CONFIG?: WNW_CONFIG;
}
}