/
githubmirror
/
marktext
Обзор
Документация
Войти
/
githubmirror
/
marktext
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/muya/examples/src/vite-env.d.ts
30 строк
1014 B
Ran Luo
feat(muya): migrate TS rewrite to packages/muya alongside legacy muyajs (#4314)
29 май 2026, 15:35
Не верифицирован
29 май 2026, 15:35
0d86641
Код
Авторство
О чём код?
/// <reference types="vite/client" /> import type { Muya } from '@muyajs/core'; declare global { interface Window { // Debugging handle assigned by main.ts so the editor instance is // reachable from the browser devtools console. muya?: Muya; } // `Intl.Segmenter` (Stage 4, ES2022) is not in the ES2020 TS lib the // examples package targets. main.ts polyfills it on Firefox where the // runtime engine lacks support — both the feature-detect (`Intl.Segmenter`) // and the polyfill assignment need a real declaration. namespace Intl { interface ISegmenterOptions { granularity?: 'grapheme' | 'word' | 'sentence'; } interface ISegmentData { segment: string; index: number; input: string; } class Segmenter { constructor(locales?: string | string[], options?: ISegmenterOptions); segment(input: string): Iterable<ISegmentData>; } } }