АБ
var options = {
path: drupalSettings.path.currentPath
}но решил вместо jsx перейти на ts и не понимаю как эти данные подхватить теперь
Size: a a a
АБ
var options = {
path: drupalSettings.path.currentPath
}AP
АБ
AP
DrupalSettings {
path: {
baseUrl: string;
currentLanguage: string;
currentPath: string;
currentPathIsAdmin: string;
isFront: boolean;
}
}DrupalSettings (с большой буквы) я описал структуру. Это что дальше? интерфейс?AP
S
var options = {
path: drupalSettings.path.currentPath
}interface Property { ... }
declare global {
interface Window {
property: Property
}
}AP
interface Property { ... }
declare global {
interface Window {
property: Property
}
}S
AP
settingsElement = document.querySelector('body > script[type="application/json"][data-drupal-selector="drupal-settings-json"]');
drupalSettings = JSON.parse(settingsElement.textContent);М
И
М
И
AT

a
AT
AT
a
AT