{"version":3,"sources":["browser/textmate/monaco-textmate-frontend-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAMrC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAW,WAAW,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AAG1D,qBAAa,UAAW,YAAW,QAAQ;IACzC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW;IAIjD,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAG9C;+BAEqB,WAAW,IAAI,UAAU,WAAW,MAAM,WAAW,WAAW,OAAO,UAAU,WAAW,MAAM;AAAxH,wBAOE;AAEF,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAElF;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAM1D","file":"../../../src/browser/textmate/monaco-textmate-frontend-bindings.d.ts","sourcesContent":["import {interfaces} from 'inversify';\r\nimport {MonacoTextmateService, OnigasmPromise} from './monaco-textmate-service';\r\nimport {FrontendApplicationContribution} from '@tartjs/core';\r\nimport {bindContributionProvider} from '@tartjs/core/lib/common';\r\nimport {LanguageGrammarDefinitionContribution} from './textmate-contribution';\r\nimport {TextmateRegistry} from './textmate-registry';\r\nimport {IOnigLib} from 'vscode-textmate';\r\nimport {isBasicWasmSupported} from '@tartjs/core/lib/browser/browser';\r\nimport wasm from 'onigasm/lib/onigasm.wasm';\r\nimport {loadWASM, OnigScanner, OnigString} from 'onigasm';\r\nimport {MonacoThemeRegistry} from './monaco-theme-registry';\r\n\r\nexport class OnigasmLib implements IOnigLib {\r\n  createOnigScanner(sources: string[]): OnigScanner {\r\n    return new OnigScanner(sources);\r\n  }\r\n\r\n  createOnigString(sources: string): OnigString {\r\n    return new OnigString(sources);\r\n  }\r\n}\r\n\r\nexport default (bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind) => {\r\n  bind(OnigasmPromise).toDynamicValue(dynamicOnigasmLib).inSingletonScope();\r\n  bind(MonacoTextmateService).toSelf().inSingletonScope();\r\n  bind(FrontendApplicationContribution).toService(MonacoTextmateService);\r\n  bindContributionProvider(bind, LanguageGrammarDefinitionContribution);\r\n  bind(TextmateRegistry).toSelf().inSingletonScope();\r\n  bind(MonacoThemeRegistry).toDynamicValue(() => MonacoThemeRegistry.SINGLETON).inSingletonScope();\r\n};\r\n\r\nexport async function dynamicOnigasmLib(ctx: interfaces.Context): Promise<IOnigLib> {\r\n  return createOnigasmLib();\r\n}\r\n\r\nexport async function createOnigasmLib(): Promise<IOnigLib> {\r\n  if (!isBasicWasmSupported) {\r\n    throw new Error('wasm not supported');\r\n  }\r\n  await loadWASM(wasm);\r\n  return new OnigasmLib();\r\n}\r\n"]}