(cssText: string)
| 3 | |
| 4 | // CSS helper function |
| 5 | export function applyCssText(cssText: string): void { |
| 6 | if (typeof cssText !== 'string' || !cssText.length) return; |
| 7 | |
| 8 | try { |
| 9 | if (Application.addCss) { |
| 10 | Application.addCss(cssText); |
| 11 | if (VERBOSE) console.info('[ns-hmr] Applied app CSS'); |
| 12 | } else { |
| 13 | const topFrame = Frame.topmost?.(); |
| 14 | const curPage = topFrame?.currentPage; |
| 15 | curPage.addCss(cssText); |
| 16 | if (VERBOSE) console.info('[ns-hmr] Applied page CSS'); |
| 17 | } |
| 18 | } catch (e) { |
| 19 | console.warn('[ns-hmr] CSS apply failed:', e?.message || String(e)); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | // Fetch helper |
| 24 | export async function fetchText(url: string): Promise<string> { |
no test coverage detected