devtools-tracing 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generate.ts +643 -0
- package/index.ts +16 -0
- package/lib/front_end/core/common/App.ts +7 -0
- package/lib/front_end/core/common/AppProvider.ts +32 -0
- package/lib/front_end/core/common/Base64.ts +47 -0
- package/lib/front_end/core/common/CharacterIdMap.ts +30 -0
- package/lib/front_end/core/common/Color.ts +2506 -0
- package/lib/front_end/core/common/ColorConverter.ts +402 -0
- package/lib/front_end/core/common/ColorUtils.ts +252 -0
- package/lib/front_end/core/common/Console.ts +114 -0
- package/lib/front_end/core/common/Debouncer.ts +15 -0
- package/lib/front_end/core/common/EventTarget.ts +52 -0
- package/lib/front_end/core/common/Gzip.ts +74 -0
- package/lib/front_end/core/common/JavaScriptMetaData.ts +29 -0
- package/lib/front_end/core/common/Lazy.ts +31 -0
- package/lib/front_end/core/common/Linkifier.ts +55 -0
- package/lib/front_end/core/common/MapWithDefault.ts +26 -0
- package/lib/front_end/core/common/Mutex.ts +55 -0
- package/lib/front_end/core/common/Object.ts +145 -0
- package/lib/front_end/core/common/ParsedURL.ts +554 -0
- package/lib/front_end/core/common/Progress.ts +180 -0
- package/lib/front_end/core/common/QueryParamHandler.ts +7 -0
- package/lib/front_end/core/common/ResolverBase.ts +85 -0
- package/lib/front_end/core/common/ResourceType.ts +588 -0
- package/lib/front_end/core/common/ReturnToPanel.ts +17 -0
- package/lib/front_end/core/common/Revealer.ts +192 -0
- package/lib/front_end/core/common/Runnable.ts +41 -0
- package/lib/front_end/core/common/SegmentedRange.ts +87 -0
- package/lib/front_end/core/common/SettingRegistration.ts +339 -0
- package/lib/front_end/core/common/Settings.ts +1497 -0
- package/lib/front_end/core/common/SimpleHistoryManager.ts +124 -0
- package/lib/front_end/core/common/StringOutputStream.ts +26 -0
- package/lib/front_end/core/common/TextDictionary.ts +48 -0
- package/lib/front_end/core/common/Throttler.ts +99 -0
- package/lib/front_end/core/common/Trie.ts +152 -0
- package/lib/front_end/core/common/Worker.ts +60 -0
- package/lib/front_end/core/common/common.ts +81 -0
- package/lib/front_end/core/host/AidaClient.ts +733 -0
- package/lib/front_end/core/host/GdpClient.ts +316 -0
- package/lib/front_end/core/host/InspectorFrontendHost.ts +648 -0
- package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +551 -0
- package/lib/front_end/core/host/Platform.ts +76 -0
- package/lib/front_end/core/host/ResourceLoader.ts +282 -0
- package/lib/front_end/core/host/UserMetrics.ts +1230 -0
- package/lib/front_end/core/host/host.ts +23 -0
- package/lib/front_end/core/i18n/ByteUtilities.ts +82 -0
- package/lib/front_end/core/i18n/DevToolsLocale.ts +87 -0
- package/lib/front_end/core/i18n/NumberFormatter.ts +82 -0
- package/lib/front_end/core/i18n/i18n.ts +17 -0
- package/lib/front_end/core/i18n/i18nImpl.ts +204 -0
- package/lib/front_end/core/i18n/i18nTypes.ts +10 -0
- package/lib/front_end/core/i18n/locales.js +14 -0
- package/lib/front_end/core/i18n/time-utilities.ts +174 -0
- package/lib/front_end/core/platform/ArrayUtilities.ts +271 -0
- package/lib/front_end/core/platform/Brand.ts +23 -0
- package/lib/front_end/core/platform/Constructor.ts +10 -0
- package/lib/front_end/core/platform/DOMUtilities.ts +138 -0
- package/lib/front_end/core/platform/DateUtilities.ts +15 -0
- package/lib/front_end/core/platform/DevToolsPath.ts +53 -0
- package/lib/front_end/core/platform/KeyboardUtilities.ts +38 -0
- package/lib/front_end/core/platform/MapUtilities.ts +95 -0
- package/lib/front_end/core/platform/MimeType.ts +175 -0
- package/lib/front_end/core/platform/NumberUtilities.ts +80 -0
- package/lib/front_end/core/platform/StringUtilities.ts +588 -0
- package/lib/front_end/core/platform/Timing.ts +17 -0
- package/lib/front_end/core/platform/TypedArrayUtilities.ts +189 -0
- package/lib/front_end/core/platform/TypescriptUtilities.ts +86 -0
- package/lib/front_end/core/platform/UIString.ts +39 -0
- package/lib/front_end/core/platform/UserVisibleError.ts +28 -0
- package/lib/front_end/core/platform/platform.ts +45 -0
- package/lib/front_end/core/protocol_client/ConnectionTransport.ts +26 -0
- package/lib/front_end/core/protocol_client/InspectorBackend.ts +1050 -0
- package/lib/front_end/core/protocol_client/NodeURL.ts +42 -0
- package/lib/front_end/core/protocol_client/protocol_client.ts +13 -0
- package/lib/front_end/core/root/Runtime.ts +609 -0
- package/lib/front_end/core/root/root.ts +6 -0
- package/lib/front_end/core/sdk/AccessibilityModel.ts +353 -0
- package/lib/front_end/core/sdk/AnimationModel.ts +1041 -0
- package/lib/front_end/core/sdk/AutofillModel.ts +184 -0
- package/lib/front_end/core/sdk/CPUProfilerModel.ts +148 -0
- package/lib/front_end/core/sdk/CPUThrottlingManager.ts +282 -0
- package/lib/front_end/core/sdk/CSSContainerQuery.ts +139 -0
- package/lib/front_end/core/sdk/CSSFontFace.ts +40 -0
- package/lib/front_end/core/sdk/CSSLayer.ts +30 -0
- package/lib/front_end/core/sdk/CSSMatchedStyles.ts +1646 -0
- package/lib/front_end/core/sdk/CSSMedia.ts +121 -0
- package/lib/front_end/core/sdk/CSSMetadata.ts +1647 -0
- package/lib/front_end/core/sdk/CSSModel.ts +1128 -0
- package/lib/front_end/core/sdk/CSSProperty.ts +384 -0
- package/lib/front_end/core/sdk/CSSPropertyParser.ts +681 -0
- package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +1395 -0
- package/lib/front_end/core/sdk/CSSQuery.ts +72 -0
- package/lib/front_end/core/sdk/CSSRule.ts +465 -0
- package/lib/front_end/core/sdk/CSSScope.ts +30 -0
- package/lib/front_end/core/sdk/CSSStartingStyle.ts +29 -0
- package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +313 -0
- package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +196 -0
- package/lib/front_end/core/sdk/CSSSupports.ts +33 -0
- package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +64 -0
- package/lib/front_end/core/sdk/ChildTargetManager.ts +314 -0
- package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +62 -0
- package/lib/front_end/core/sdk/Connections.ts +293 -0
- package/lib/front_end/core/sdk/ConsoleModel.ts +808 -0
- package/lib/front_end/core/sdk/ConsoleModelTypes.ts +15 -0
- package/lib/front_end/core/sdk/Cookie.ts +319 -0
- package/lib/front_end/core/sdk/CookieModel.ts +239 -0
- package/lib/front_end/core/sdk/CookieParser.ts +185 -0
- package/lib/front_end/core/sdk/DOMDebuggerModel.ts +787 -0
- package/lib/front_end/core/sdk/DOMModel.ts +1961 -0
- package/lib/front_end/core/sdk/DebuggerModel.ts +1605 -0
- package/lib/front_end/core/sdk/EmulationModel.ts +648 -0
- package/lib/front_end/core/sdk/EnhancedTracesParser.ts +515 -0
- package/lib/front_end/core/sdk/EventBreakpointsModel.ts +183 -0
- package/lib/front_end/core/sdk/FrameAssociated.ts +11 -0
- package/lib/front_end/core/sdk/FrameManager.ts +259 -0
- package/lib/front_end/core/sdk/HeapProfilerModel.ts +225 -0
- package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +77 -0
- package/lib/front_end/core/sdk/IOModel.ts +91 -0
- package/lib/front_end/core/sdk/IsolateManager.ts +257 -0
- package/lib/front_end/core/sdk/IssuesModel.ts +70 -0
- package/lib/front_end/core/sdk/LayerTreeBase.ts +169 -0
- package/lib/front_end/core/sdk/LogModel.ts +56 -0
- package/lib/front_end/core/sdk/NetworkManager.ts +2823 -0
- package/lib/front_end/core/sdk/NetworkRequest.ts +2253 -0
- package/lib/front_end/core/sdk/OverlayColorGenerator.ts +52 -0
- package/lib/front_end/core/sdk/OverlayModel.ts +1011 -0
- package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +522 -0
- package/lib/front_end/core/sdk/PageLoad.ts +35 -0
- package/lib/front_end/core/sdk/PageResourceLoader.ts +435 -0
- package/lib/front_end/core/sdk/PaintProfiler.ts +110 -0
- package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +84 -0
- package/lib/front_end/core/sdk/PreloadingModel.ts +863 -0
- package/lib/front_end/core/sdk/RehydratingConnection.ts +386 -0
- package/lib/front_end/core/sdk/RehydratingObject.ts +66 -0
- package/lib/front_end/core/sdk/RemoteObject.ts +1160 -0
- package/lib/front_end/core/sdk/Resource.ts +232 -0
- package/lib/front_end/core/sdk/ResourceTreeModel.ts +1160 -0
- package/lib/front_end/core/sdk/RuntimeModel.ts +732 -0
- package/lib/front_end/core/sdk/SDKModel.ts +65 -0
- package/lib/front_end/core/sdk/ScopeTreeCache.ts +45 -0
- package/lib/front_end/core/sdk/ScreenCaptureModel.ts +255 -0
- package/lib/front_end/core/sdk/Script.ts +534 -0
- package/lib/front_end/core/sdk/SecurityOriginManager.ts +76 -0
- package/lib/front_end/core/sdk/ServerSentEvents.ts +80 -0
- package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +122 -0
- package/lib/front_end/core/sdk/ServerTiming.ts +260 -0
- package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +377 -0
- package/lib/front_end/core/sdk/ServiceWorkerManager.ts +605 -0
- package/lib/front_end/core/sdk/SourceMap.ts +867 -0
- package/lib/front_end/core/sdk/SourceMapCache.ts +54 -0
- package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +156 -0
- package/lib/front_end/core/sdk/SourceMapManager.ts +239 -0
- package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +189 -0
- package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +508 -0
- package/lib/front_end/core/sdk/StorageBucketsModel.ts +204 -0
- package/lib/front_end/core/sdk/StorageKeyManager.ts +98 -0
- package/lib/front_end/core/sdk/Target.ts +332 -0
- package/lib/front_end/core/sdk/TargetManager.ts +453 -0
- package/lib/front_end/core/sdk/TraceObject.ts +61 -0
- package/lib/front_end/core/sdk/WebAuthnModel.ts +104 -0
- package/lib/front_end/core/sdk/sdk.ts +174 -0
- package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +59 -0
- package/lib/front_end/generated/InspectorBackendCommands.js +1617 -0
- package/lib/front_end/generated/SupportedCSSProperties.js +7512 -0
- package/lib/front_end/generated/protocol-proxy-api.d.ts +5022 -0
- package/lib/front_end/generated/protocol.ts +22014 -0
- package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +571 -0
- package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +103 -0
- package/lib/front_end/models/cpu_profile/cpu_profile.ts +11 -0
- package/lib/front_end/models/formatter/FormatterWorkerPool.ts +219 -0
- package/lib/front_end/models/formatter/ScriptFormatter.ts +112 -0
- package/lib/front_end/models/formatter/formatter.ts +8 -0
- package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +37 -0
- package/lib/front_end/models/text_utils/ContentData.ts +199 -0
- package/lib/front_end/models/text_utils/ContentProvider.ts +68 -0
- package/lib/front_end/models/text_utils/StaticContentProvider.ts +49 -0
- package/lib/front_end/models/text_utils/StreamingContentData.ts +108 -0
- package/lib/front_end/models/text_utils/Text.ts +90 -0
- package/lib/front_end/models/text_utils/TextCursor.ts +44 -0
- package/lib/front_end/models/text_utils/TextRange.ts +266 -0
- package/lib/front_end/models/text_utils/TextUtils.ts +401 -0
- package/lib/front_end/models/text_utils/WasmDisassembly.ts +87 -0
- package/lib/front_end/models/text_utils/text_utils.ts +27 -0
- package/lib/front_end/models/trace/EntityMapper.ts +141 -0
- package/lib/front_end/models/trace/EventsSerializer.ts +101 -0
- package/lib/front_end/models/trace/LanternComputationData.ts +438 -0
- package/lib/front_end/models/trace/ModelImpl.ts +236 -0
- package/lib/front_end/models/trace/Name.ts +136 -0
- package/lib/front_end/models/trace/Processor.ts +652 -0
- package/lib/front_end/models/trace/Styles.ts +1138 -0
- package/lib/front_end/models/trace/extras/FilmStrip.ts +78 -0
- package/lib/front_end/models/trace/extras/MainThreadActivity.ts +86 -0
- package/lib/front_end/models/trace/extras/ScriptDuplication.ts +236 -0
- package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +203 -0
- package/lib/front_end/models/trace/extras/ThirdParties.ts +164 -0
- package/lib/front_end/models/trace/extras/TraceFilter.ts +62 -0
- package/lib/front_end/models/trace/extras/TraceTree.ts +701 -0
- package/lib/front_end/models/trace/extras/extras.ts +11 -0
- package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +128 -0
- package/lib/front_end/models/trace/handlers/AnimationHandler.ts +36 -0
- package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +239 -0
- package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +183 -0
- package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +31 -0
- package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +306 -0
- package/lib/front_end/models/trace/handlers/FlowsHandler.ts +175 -0
- package/lib/front_end/models/trace/handlers/FramesHandler.ts +571 -0
- package/lib/front_end/models/trace/handlers/GPUHandler.ts +50 -0
- package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +183 -0
- package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +193 -0
- package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +168 -0
- package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +109 -0
- package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +35 -0
- package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +123 -0
- package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +573 -0
- package/lib/front_end/models/trace/handlers/MemoryHandler.ts +31 -0
- package/lib/front_end/models/trace/handlers/MetaHandler.ts +525 -0
- package/lib/front_end/models/trace/handlers/ModelHandlers.ts +34 -0
- package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +672 -0
- package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +52 -0
- package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +460 -0
- package/lib/front_end/models/trace/handlers/RendererHandler.ts +428 -0
- package/lib/front_end/models/trace/handlers/SamplesHandler.ts +271 -0
- package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +122 -0
- package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +336 -0
- package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +110 -0
- package/lib/front_end/models/trace/handlers/Threads.ts +139 -0
- package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +400 -0
- package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +233 -0
- package/lib/front_end/models/trace/handlers/WarningsHandler.ts +162 -0
- package/lib/front_end/models/trace/handlers/WorkersHandler.ts +45 -0
- package/lib/front_end/models/trace/handlers/handlers.ts +8 -0
- package/lib/front_end/models/trace/handlers/helpers.ts +196 -0
- package/lib/front_end/models/trace/handlers/types.ts +75 -0
- package/lib/front_end/models/trace/helpers/Extensions.ts +54 -0
- package/lib/front_end/models/trace/helpers/Network.ts +129 -0
- package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +544 -0
- package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +87 -0
- package/lib/front_end/models/trace/helpers/Timing.ts +248 -0
- package/lib/front_end/models/trace/helpers/Trace.ts +928 -0
- package/lib/front_end/models/trace/helpers/TreeHelpers.ts +320 -0
- package/lib/front_end/models/trace/helpers/helpers.ts +11 -0
- package/lib/front_end/models/trace/insights/CLSCulprits.ts +668 -0
- package/lib/front_end/models/trace/insights/Cache.ts +269 -0
- package/lib/front_end/models/trace/insights/Common.ts +453 -0
- package/lib/front_end/models/trace/insights/DOMSize.ts +223 -0
- package/lib/front_end/models/trace/insights/DocumentLatency.ts +319 -0
- package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +126 -0
- package/lib/front_end/models/trace/insights/FontDisplay.ts +119 -0
- package/lib/front_end/models/trace/insights/ForcedReflow.ts +220 -0
- package/lib/front_end/models/trace/insights/INPBreakdown.ts +171 -0
- package/lib/front_end/models/trace/insights/ImageDelivery.ts +348 -0
- package/lib/front_end/models/trace/insights/LCPBreakdown.ts +268 -0
- package/lib/front_end/models/trace/insights/LCPDiscovery.ts +237 -0
- package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +138 -0
- package/lib/front_end/models/trace/insights/Models.ts +22 -0
- package/lib/front_end/models/trace/insights/ModernHTTP.ts +257 -0
- package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +726 -0
- package/lib/front_end/models/trace/insights/RenderBlocking.ts +257 -0
- package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +175 -0
- package/lib/front_end/models/trace/insights/Statistics.ts +101 -0
- package/lib/front_end/models/trace/insights/ThirdParties.ts +130 -0
- package/lib/front_end/models/trace/insights/Viewport.ts +138 -0
- package/lib/front_end/models/trace/insights/insights.ts +10 -0
- package/lib/front_end/models/trace/insights/types.ts +157 -0
- package/lib/front_end/models/trace/lantern/core/LanternError.ts +7 -0
- package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +619 -0
- package/lib/front_end/models/trace/lantern/core/core.ts +6 -0
- package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +345 -0
- package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +80 -0
- package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +101 -0
- package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +636 -0
- package/lib/front_end/models/trace/lantern/graph/graph.ts +8 -0
- package/lib/front_end/models/trace/lantern/lantern.ts +17 -0
- package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +187 -0
- package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +88 -0
- package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +92 -0
- package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +72 -0
- package/lib/front_end/models/trace/lantern/metrics/Metric.ts +126 -0
- package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +126 -0
- package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +82 -0
- package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +112 -0
- package/lib/front_end/models/trace/lantern/metrics/metrics.ts +12 -0
- package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +150 -0
- package/lib/front_end/models/trace/lantern/simulation/Constants.ts +46 -0
- package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +61 -0
- package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +196 -0
- package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +556 -0
- package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +192 -0
- package/lib/front_end/models/trace/lantern/simulation/simulation.ts +10 -0
- package/lib/front_end/models/trace/lantern/types/Lantern.ts +220 -0
- package/lib/front_end/models/trace/lantern/types/types.ts +5 -0
- package/lib/front_end/models/trace/trace.ts +33 -0
- package/lib/front_end/models/trace/types/Configuration.ts +110 -0
- package/lib/front_end/models/trace/types/Extensions.ts +136 -0
- package/lib/front_end/models/trace/types/File.ts +281 -0
- package/lib/front_end/models/trace/types/Overlays.ts +138 -0
- package/lib/front_end/models/trace/types/Timing.ts +30 -0
- package/lib/front_end/models/trace/types/TraceEvents.ts +3277 -0
- package/lib/front_end/models/trace/types/types.ts +10 -0
- package/lib/front_end/third_party/i18n/LICENSE +202 -0
- package/lib/front_end/third_party/i18n/README.chromium +15 -0
- package/lib/front_end/third_party/i18n/i18n-impl.ts +61 -0
- package/lib/front_end/third_party/i18n/i18n.ts +11 -0
- package/lib/front_end/third_party/i18n/localized-string-set.ts +129 -0
- package/lib/front_end/third_party/intl-messageformat/LICENSE +33 -0
- package/lib/front_end/third_party/intl-messageformat/README.chromium +24 -0
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +16 -0
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +33 -0
- package/lib/front_end/third_party/intl-messageformat/package/README.md +3 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.js +13 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +5 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +1710 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +1815 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +10 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +229 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +28 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +48 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +179 -0
- package/lib/front_end/third_party/intl-messageformat/package/package.json +42 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.js +230 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +28 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.js +51 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +182 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +79 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +15 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +153 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +139 -0
- package/lib/front_end/third_party/legacy-javascript/LICENSE +202 -0
- package/lib/front_end/third_party/legacy-javascript/README.chromium +13 -0
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +8 -0
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +3 -0
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +18 -0
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +943 -0
- package/lib/front_end/third_party/legacy-javascript/package.json +8 -0
- package/lib/front_end/third_party/legacy-javascript/rebuild.sh +9 -0
- package/lib/front_end/third_party/third-party-web/LICENSE +20 -0
- package/lib/front_end/third_party/third-party-web/README.chromium +13 -0
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +149 -0
- package/lib/front_end/third_party/third-party-web/package/LICENSE +20 -0
- package/lib/front_end/third_party/third-party-web/package/README.md +929 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/facades.md +46 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +1006 -0
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +139 -0
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +44 -0
- package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +27 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +34 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +246 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +36 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +9 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +5 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +151 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +14 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/package.json +46 -0
- package/lib/front_end/third_party/third-party-web/package.json +8 -0
- package/lib/front_end/third_party/third-party-web/rebuild.sh +13 -0
- package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +8 -0
- package/lib/front_end/third_party/third-party-web/third-party-web.ts +3 -0
- package/package.json +24 -0
- package/patches/chrome-devtools-frontend+1.0.1533544.patch +187 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-messageformat/src/core.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,KAAK,EAAE,oBAAoB,EAAC,MAAM,oCAAoC,CAAA;AAE9E,OAAO,EAEL,UAAU,EACV,OAAO,EAEP,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAElB,MAAM,cAAc,CAAA;AAsCrB,MAAM,WAAW,OAAO;IACtB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AA2CD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAI9B;gBAEC,OAAO,EAAE,MAAM,GAAG,oBAAoB,EAAE,EACxC,OAAO,GAAE,MAAM,GAAG,MAAM,EAAoC,EAC5D,eAAe,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAClC,IAAI,CAAC,EAAE,OAAO;IAgChB,MAAM,yJAyBL;IACD,aAAa,6IAWV;IACH,eAAe;;MAEb;IACF,MAAM,+BAAiB;IACvB,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAsB;IAE1D,MAAM,KAAK,aAAa,WAOvB;IACD,MAAM,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,SAAS,CAAQ;IAIhD,MAAM,CAAC,OAAO,EAAE,OAAO,CAmEtB;CACF"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
4
|
+
Copyrights licensed under the New BSD License.
|
|
5
|
+
See the accompanying LICENSE file for terms.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.IntlMessageFormat = void 0;
|
|
9
|
+
var tslib_1 = require("tslib");
|
|
10
|
+
var icu_messageformat_parser_1 = require("@formatjs/icu-messageformat-parser");
|
|
11
|
+
var fast_memoize_1 = tslib_1.__importStar(require("@formatjs/fast-memoize"));
|
|
12
|
+
var formatters_1 = require("./formatters");
|
|
13
|
+
// -- MessageFormat --------------------------------------------------------
|
|
14
|
+
function mergeConfig(c1, c2) {
|
|
15
|
+
if (!c2) {
|
|
16
|
+
return c1;
|
|
17
|
+
}
|
|
18
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {
|
|
19
|
+
all[k] = tslib_1.__assign(tslib_1.__assign({}, c1[k]), (c2[k] || {}));
|
|
20
|
+
return all;
|
|
21
|
+
}, {}));
|
|
22
|
+
}
|
|
23
|
+
function mergeConfigs(defaultConfig, configs) {
|
|
24
|
+
if (!configs) {
|
|
25
|
+
return defaultConfig;
|
|
26
|
+
}
|
|
27
|
+
return Object.keys(defaultConfig).reduce(function (all, k) {
|
|
28
|
+
all[k] = mergeConfig(defaultConfig[k], configs[k]);
|
|
29
|
+
return all;
|
|
30
|
+
}, tslib_1.__assign({}, defaultConfig));
|
|
31
|
+
}
|
|
32
|
+
function createFastMemoizeCache(store) {
|
|
33
|
+
return {
|
|
34
|
+
create: function () {
|
|
35
|
+
return {
|
|
36
|
+
has: function (key) {
|
|
37
|
+
return key in store;
|
|
38
|
+
},
|
|
39
|
+
get: function (key) {
|
|
40
|
+
return store[key];
|
|
41
|
+
},
|
|
42
|
+
set: function (key, value) {
|
|
43
|
+
store[key] = value;
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function createDefaultFormatters(cache) {
|
|
50
|
+
if (cache === void 0) { cache = {
|
|
51
|
+
number: {},
|
|
52
|
+
dateTime: {},
|
|
53
|
+
pluralRules: {},
|
|
54
|
+
}; }
|
|
55
|
+
return {
|
|
56
|
+
getNumberFormat: fast_memoize_1.default(function () {
|
|
57
|
+
var _a;
|
|
58
|
+
var args = [];
|
|
59
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
60
|
+
args[_i] = arguments[_i];
|
|
61
|
+
}
|
|
62
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args)))();
|
|
63
|
+
}, {
|
|
64
|
+
cache: createFastMemoizeCache(cache.number),
|
|
65
|
+
strategy: fast_memoize_1.strategies.variadic,
|
|
66
|
+
}),
|
|
67
|
+
getDateTimeFormat: fast_memoize_1.default(function () {
|
|
68
|
+
var _a;
|
|
69
|
+
var args = [];
|
|
70
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
71
|
+
args[_i] = arguments[_i];
|
|
72
|
+
}
|
|
73
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args)))();
|
|
74
|
+
}, {
|
|
75
|
+
cache: createFastMemoizeCache(cache.dateTime),
|
|
76
|
+
strategy: fast_memoize_1.strategies.variadic,
|
|
77
|
+
}),
|
|
78
|
+
getPluralRules: fast_memoize_1.default(function () {
|
|
79
|
+
var _a;
|
|
80
|
+
var args = [];
|
|
81
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
82
|
+
args[_i] = arguments[_i];
|
|
83
|
+
}
|
|
84
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, tslib_1.__spreadArray([void 0], args)))();
|
|
85
|
+
}, {
|
|
86
|
+
cache: createFastMemoizeCache(cache.pluralRules),
|
|
87
|
+
strategy: fast_memoize_1.strategies.variadic,
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
var IntlMessageFormat = /** @class */ (function () {
|
|
92
|
+
function IntlMessageFormat(message, locales, overrideFormats, opts) {
|
|
93
|
+
var _this = this;
|
|
94
|
+
if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }
|
|
95
|
+
this.formatterCache = {
|
|
96
|
+
number: {},
|
|
97
|
+
dateTime: {},
|
|
98
|
+
pluralRules: {},
|
|
99
|
+
};
|
|
100
|
+
this.format = function (values) {
|
|
101
|
+
var parts = _this.formatToParts(values);
|
|
102
|
+
// Hot path for straight simple msg translations
|
|
103
|
+
if (parts.length === 1) {
|
|
104
|
+
return parts[0].value;
|
|
105
|
+
}
|
|
106
|
+
var result = parts.reduce(function (all, part) {
|
|
107
|
+
if (!all.length ||
|
|
108
|
+
part.type !== formatters_1.PART_TYPE.literal ||
|
|
109
|
+
typeof all[all.length - 1] !== 'string') {
|
|
110
|
+
all.push(part.value);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
all[all.length - 1] += part.value;
|
|
114
|
+
}
|
|
115
|
+
return all;
|
|
116
|
+
}, []);
|
|
117
|
+
if (result.length <= 1) {
|
|
118
|
+
return result[0] || '';
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
};
|
|
122
|
+
this.formatToParts = function (values) {
|
|
123
|
+
return formatters_1.formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);
|
|
124
|
+
};
|
|
125
|
+
this.resolvedOptions = function () { return ({
|
|
126
|
+
locale: Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],
|
|
127
|
+
}); };
|
|
128
|
+
this.getAst = function () { return _this.ast; };
|
|
129
|
+
if (typeof message === 'string') {
|
|
130
|
+
this.message = message;
|
|
131
|
+
if (!IntlMessageFormat.__parse) {
|
|
132
|
+
throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');
|
|
133
|
+
}
|
|
134
|
+
// Parse string messages into an AST.
|
|
135
|
+
this.ast = IntlMessageFormat.__parse(message, {
|
|
136
|
+
ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.ast = message;
|
|
141
|
+
}
|
|
142
|
+
if (!Array.isArray(this.ast)) {
|
|
143
|
+
throw new TypeError('A message must be provided as a String or AST.');
|
|
144
|
+
}
|
|
145
|
+
// Creates a new object with the specified `formats` merged with the default
|
|
146
|
+
// formats.
|
|
147
|
+
this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);
|
|
148
|
+
// Defined first because it's used to build the format pattern.
|
|
149
|
+
this.locales = locales;
|
|
150
|
+
this.formatters =
|
|
151
|
+
(opts && opts.formatters) || createDefaultFormatters(this.formatterCache);
|
|
152
|
+
}
|
|
153
|
+
Object.defineProperty(IntlMessageFormat, "defaultLocale", {
|
|
154
|
+
get: function () {
|
|
155
|
+
if (!IntlMessageFormat.memoizedDefaultLocale) {
|
|
156
|
+
IntlMessageFormat.memoizedDefaultLocale =
|
|
157
|
+
new Intl.NumberFormat().resolvedOptions().locale;
|
|
158
|
+
}
|
|
159
|
+
return IntlMessageFormat.memoizedDefaultLocale;
|
|
160
|
+
},
|
|
161
|
+
enumerable: false,
|
|
162
|
+
configurable: true
|
|
163
|
+
});
|
|
164
|
+
IntlMessageFormat.memoizedDefaultLocale = null;
|
|
165
|
+
IntlMessageFormat.__parse = icu_messageformat_parser_1.parse;
|
|
166
|
+
// Default format options used as the prototype of the `formats` provided to the
|
|
167
|
+
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
168
|
+
// and Intl.DateTimeFormat instances.
|
|
169
|
+
IntlMessageFormat.formats = {
|
|
170
|
+
number: {
|
|
171
|
+
integer: {
|
|
172
|
+
maximumFractionDigits: 0,
|
|
173
|
+
},
|
|
174
|
+
currency: {
|
|
175
|
+
style: 'currency',
|
|
176
|
+
},
|
|
177
|
+
percent: {
|
|
178
|
+
style: 'percent',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
date: {
|
|
182
|
+
short: {
|
|
183
|
+
month: 'numeric',
|
|
184
|
+
day: 'numeric',
|
|
185
|
+
year: '2-digit',
|
|
186
|
+
},
|
|
187
|
+
medium: {
|
|
188
|
+
month: 'short',
|
|
189
|
+
day: 'numeric',
|
|
190
|
+
year: 'numeric',
|
|
191
|
+
},
|
|
192
|
+
long: {
|
|
193
|
+
month: 'long',
|
|
194
|
+
day: 'numeric',
|
|
195
|
+
year: 'numeric',
|
|
196
|
+
},
|
|
197
|
+
full: {
|
|
198
|
+
weekday: 'long',
|
|
199
|
+
month: 'long',
|
|
200
|
+
day: 'numeric',
|
|
201
|
+
year: 'numeric',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
time: {
|
|
205
|
+
short: {
|
|
206
|
+
hour: 'numeric',
|
|
207
|
+
minute: 'numeric',
|
|
208
|
+
},
|
|
209
|
+
medium: {
|
|
210
|
+
hour: 'numeric',
|
|
211
|
+
minute: 'numeric',
|
|
212
|
+
second: 'numeric',
|
|
213
|
+
},
|
|
214
|
+
long: {
|
|
215
|
+
hour: 'numeric',
|
|
216
|
+
minute: 'numeric',
|
|
217
|
+
second: 'numeric',
|
|
218
|
+
timeZoneName: 'short',
|
|
219
|
+
},
|
|
220
|
+
full: {
|
|
221
|
+
hour: 'numeric',
|
|
222
|
+
minute: 'numeric',
|
|
223
|
+
second: 'numeric',
|
|
224
|
+
timeZoneName: 'short',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
return IntlMessageFormat;
|
|
229
|
+
}());
|
|
230
|
+
exports.IntlMessageFormat = IntlMessageFormat;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare enum ErrorCode {
|
|
2
|
+
MISSING_VALUE = "MISSING_VALUE",
|
|
3
|
+
INVALID_VALUE = "INVALID_VALUE",
|
|
4
|
+
MISSING_INTL_API = "MISSING_INTL_API"
|
|
5
|
+
}
|
|
6
|
+
export declare class FormatError extends Error {
|
|
7
|
+
readonly code: ErrorCode;
|
|
8
|
+
/**
|
|
9
|
+
* Original message we're trying to format
|
|
10
|
+
* `undefined` if we're only dealing w/ AST
|
|
11
|
+
*
|
|
12
|
+
* @type {(string | undefined)}
|
|
13
|
+
* @memberof FormatError
|
|
14
|
+
*/
|
|
15
|
+
readonly originalMessage: string | undefined;
|
|
16
|
+
constructor(msg: string, code: ErrorCode, originalMessage?: string);
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
export declare class InvalidValueError extends FormatError {
|
|
20
|
+
constructor(variableId: string, value: any, options: string[], originalMessage?: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class InvalidValueTypeError extends FormatError {
|
|
23
|
+
constructor(value: any, type: string, originalMessage?: string);
|
|
24
|
+
}
|
|
25
|
+
export declare class MissingValueError extends FormatError {
|
|
26
|
+
constructor(variableId: string, originalMessage?: string);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-messageformat/src/error.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IAEnB,aAAa,kBAAkB;IAE/B,aAAa,kBAAkB;IAE/B,gBAAgB,qBAAqB;CACtC;AAED,qBAAa,WAAY,SAAQ,KAAK;IACpC,SAAgB,IAAI,EAAE,SAAS,CAAA;IAC/B;;;;;;OAMG;IACH,SAAgB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;gBACvC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,EAAE,MAAM;IAK3D,QAAQ;CAGhB;AAED,qBAAa,iBAAkB,SAAQ,WAAW;gBAE9C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EAAE,EACjB,eAAe,CAAC,EAAE,MAAM;CAU3B;AAED,qBAAa,qBAAsB,SAAQ,WAAW;gBACxC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;CAO/D;AAED,qBAAa,iBAAkB,SAAQ,WAAW;gBACpC,UAAU,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;CAOzD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MissingValueError = exports.InvalidValueTypeError = exports.InvalidValueError = exports.FormatError = exports.ErrorCode = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var ErrorCode;
|
|
6
|
+
(function (ErrorCode) {
|
|
7
|
+
// When we have a placeholder but no value to format
|
|
8
|
+
ErrorCode["MISSING_VALUE"] = "MISSING_VALUE";
|
|
9
|
+
// When value supplied is invalid
|
|
10
|
+
ErrorCode["INVALID_VALUE"] = "INVALID_VALUE";
|
|
11
|
+
// When we need specific Intl API but it's not available
|
|
12
|
+
ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API";
|
|
13
|
+
})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
|
|
14
|
+
var FormatError = /** @class */ (function (_super) {
|
|
15
|
+
tslib_1.__extends(FormatError, _super);
|
|
16
|
+
function FormatError(msg, code, originalMessage) {
|
|
17
|
+
var _this = _super.call(this, msg) || this;
|
|
18
|
+
_this.code = code;
|
|
19
|
+
_this.originalMessage = originalMessage;
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
FormatError.prototype.toString = function () {
|
|
23
|
+
return "[formatjs Error: " + this.code + "] " + this.message;
|
|
24
|
+
};
|
|
25
|
+
return FormatError;
|
|
26
|
+
}(Error));
|
|
27
|
+
exports.FormatError = FormatError;
|
|
28
|
+
var InvalidValueError = /** @class */ (function (_super) {
|
|
29
|
+
tslib_1.__extends(InvalidValueError, _super);
|
|
30
|
+
function InvalidValueError(variableId, value, options, originalMessage) {
|
|
31
|
+
return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
32
|
+
}
|
|
33
|
+
return InvalidValueError;
|
|
34
|
+
}(FormatError));
|
|
35
|
+
exports.InvalidValueError = InvalidValueError;
|
|
36
|
+
var InvalidValueTypeError = /** @class */ (function (_super) {
|
|
37
|
+
tslib_1.__extends(InvalidValueTypeError, _super);
|
|
38
|
+
function InvalidValueTypeError(value, type, originalMessage) {
|
|
39
|
+
return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
40
|
+
}
|
|
41
|
+
return InvalidValueTypeError;
|
|
42
|
+
}(FormatError));
|
|
43
|
+
exports.InvalidValueTypeError = InvalidValueTypeError;
|
|
44
|
+
var MissingValueError = /** @class */ (function (_super) {
|
|
45
|
+
tslib_1.__extends(MissingValueError, _super);
|
|
46
|
+
function MissingValueError(variableId, originalMessage) {
|
|
47
|
+
return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
48
|
+
}
|
|
49
|
+
return MissingValueError;
|
|
50
|
+
}(FormatError));
|
|
51
|
+
exports.MissingValueError = MissingValueError;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MessageFormatElement } from 'icu-messageformat-parser/index';
|
|
2
|
+
export interface Formats {
|
|
3
|
+
number: Record<string, Intl.NumberFormatOptions>;
|
|
4
|
+
date: Record<string, Intl.DateTimeFormatOptions>;
|
|
5
|
+
time: Record<string, Intl.DateTimeFormatOptions>;
|
|
6
|
+
}
|
|
7
|
+
export interface FormatterCache {
|
|
8
|
+
number: Record<string, Intl.NumberFormat>;
|
|
9
|
+
dateTime: Record<string, Intl.DateTimeFormat>;
|
|
10
|
+
pluralRules: Record<string, Intl.PluralRules>;
|
|
11
|
+
}
|
|
12
|
+
export interface Formatters {
|
|
13
|
+
getNumberFormat(...args: ConstructorParameters<typeof Intl.NumberFormat>): Intl.NumberFormat;
|
|
14
|
+
getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): Intl.DateTimeFormat;
|
|
15
|
+
getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules;
|
|
16
|
+
}
|
|
17
|
+
export declare enum PART_TYPE {
|
|
18
|
+
literal = 0,
|
|
19
|
+
object = 1
|
|
20
|
+
}
|
|
21
|
+
export interface LiteralPart {
|
|
22
|
+
type: PART_TYPE.literal;
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ObjectPart<T = any> {
|
|
26
|
+
type: PART_TYPE.object;
|
|
27
|
+
value: T;
|
|
28
|
+
}
|
|
29
|
+
export declare type MessageFormatPart<T> = LiteralPart | ObjectPart<T>;
|
|
30
|
+
export declare type PrimitiveType = string | number | boolean | null | undefined | Date;
|
|
31
|
+
export declare function isFormatXMLElementFn<T>(el: PrimitiveType | T | FormatXMLElementFn<T>): el is FormatXMLElementFn<T>;
|
|
32
|
+
export declare function formatToParts<T>(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>, currentPluralValue?: number, originalMessage?: string): MessageFormatPart<T>[];
|
|
33
|
+
export declare type FormatXMLElementFn<T, R = string | T | Array<string | T>> = (parts: Array<string | T>) => R;
|
|
34
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-messageformat/src/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,oBAAoB,EAGrB,MAAM,oCAAoC,CAAA;AAS3C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC7C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;CAC9C;AAED,MAAM,WAAW,UAAU;IACzB,eAAe,CACb,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,GACvD,IAAI,CAAC,YAAY,CAAA;IACpB,iBAAiB,CACf,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,GACzD,IAAI,CAAC,cAAc,CAAA;IACtB,cAAc,CACZ,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,GACtD,IAAI,CAAC,WAAW,CAAA;CACpB;AAED,oBAAY,SAAS;IACnB,OAAO,IAAA;IACP,MAAM,IAAA;CACP;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG;IACjC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAA;IACtB,KAAK,EAAE,CAAC,CAAA;CACT;AAED,oBAAY,iBAAiB,CAAC,CAAC,IAAI,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;AAE9D,oBAAY,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAA;AAuB/E,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,EAAE,EAAE,aAAa,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAC5C,EAAE,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAE7B;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAC7B,GAAG,EAAE,oBAAoB,EAAE,EAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAClE,kBAAkB,CAAC,EAAE,MAAM,EAE3B,eAAe,CAAC,EAAE,MAAM,GACvB,iBAAiB,CAAC,CAAC,CAAC,EAAE,CA6LxB;AAED,oBAAY,kBAAkB,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACtE,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KACrB,CAAC,CAAA"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatToParts = exports.isFormatXMLElementFn = exports.PART_TYPE = void 0;
|
|
4
|
+
var icu_messageformat_parser_1 = require("@formatjs/icu-messageformat-parser");
|
|
5
|
+
var error_1 = require("./error");
|
|
6
|
+
var PART_TYPE;
|
|
7
|
+
(function (PART_TYPE) {
|
|
8
|
+
PART_TYPE[PART_TYPE["literal"] = 0] = "literal";
|
|
9
|
+
PART_TYPE[PART_TYPE["object"] = 1] = "object";
|
|
10
|
+
})(PART_TYPE = exports.PART_TYPE || (exports.PART_TYPE = {}));
|
|
11
|
+
function mergeLiteral(parts) {
|
|
12
|
+
if (parts.length < 2) {
|
|
13
|
+
return parts;
|
|
14
|
+
}
|
|
15
|
+
return parts.reduce(function (all, part) {
|
|
16
|
+
var lastPart = all[all.length - 1];
|
|
17
|
+
if (!lastPart ||
|
|
18
|
+
lastPart.type !== PART_TYPE.literal ||
|
|
19
|
+
part.type !== PART_TYPE.literal) {
|
|
20
|
+
all.push(part);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
lastPart.value += part.value;
|
|
24
|
+
}
|
|
25
|
+
return all;
|
|
26
|
+
}, []);
|
|
27
|
+
}
|
|
28
|
+
function isFormatXMLElementFn(el) {
|
|
29
|
+
return typeof el === 'function';
|
|
30
|
+
}
|
|
31
|
+
exports.isFormatXMLElementFn = isFormatXMLElementFn;
|
|
32
|
+
// TODO(skeleton): add skeleton support
|
|
33
|
+
function formatToParts(els, locales, formatters, formats, values, currentPluralValue,
|
|
34
|
+
// For debugging
|
|
35
|
+
originalMessage) {
|
|
36
|
+
// Hot path for straight simple msg translations
|
|
37
|
+
if (els.length === 1 && icu_messageformat_parser_1.isLiteralElement(els[0])) {
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
type: PART_TYPE.literal,
|
|
41
|
+
value: els[0].value,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
var result = [];
|
|
46
|
+
for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {
|
|
47
|
+
var el = els_1[_i];
|
|
48
|
+
// Exit early for string parts.
|
|
49
|
+
if (icu_messageformat_parser_1.isLiteralElement(el)) {
|
|
50
|
+
result.push({
|
|
51
|
+
type: PART_TYPE.literal,
|
|
52
|
+
value: el.value,
|
|
53
|
+
});
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
// TODO: should this part be literal type?
|
|
57
|
+
// Replace `#` in plural rules with the actual numeric value.
|
|
58
|
+
if (icu_messageformat_parser_1.isPoundElement(el)) {
|
|
59
|
+
if (typeof currentPluralValue === 'number') {
|
|
60
|
+
result.push({
|
|
61
|
+
type: PART_TYPE.literal,
|
|
62
|
+
value: formatters.getNumberFormat(locales).format(currentPluralValue),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
var varName = el.value;
|
|
68
|
+
// Enforce that all required values are provided by the caller.
|
|
69
|
+
if (!(values && varName in values)) {
|
|
70
|
+
throw new error_1.MissingValueError(varName, originalMessage);
|
|
71
|
+
}
|
|
72
|
+
var value = values[varName];
|
|
73
|
+
if (icu_messageformat_parser_1.isArgumentElement(el)) {
|
|
74
|
+
if (!value || typeof value === 'string' || typeof value === 'number') {
|
|
75
|
+
value =
|
|
76
|
+
typeof value === 'string' || typeof value === 'number'
|
|
77
|
+
? String(value)
|
|
78
|
+
: '';
|
|
79
|
+
}
|
|
80
|
+
result.push({
|
|
81
|
+
type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,
|
|
82
|
+
value: value,
|
|
83
|
+
});
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
// Recursively format plural and select parts' option — which can be a
|
|
87
|
+
// nested pattern structure. The choosing of the option to use is
|
|
88
|
+
// abstracted-by and delegated-to the part helper object.
|
|
89
|
+
if (icu_messageformat_parser_1.isDateElement(el)) {
|
|
90
|
+
var style = typeof el.style === 'string'
|
|
91
|
+
? formats.date[el.style]
|
|
92
|
+
: icu_messageformat_parser_1.isDateTimeSkeleton(el.style)
|
|
93
|
+
? el.style.parsedOptions
|
|
94
|
+
: undefined;
|
|
95
|
+
result.push({
|
|
96
|
+
type: PART_TYPE.literal,
|
|
97
|
+
value: formatters
|
|
98
|
+
.getDateTimeFormat(locales, style)
|
|
99
|
+
.format(value),
|
|
100
|
+
});
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (icu_messageformat_parser_1.isTimeElement(el)) {
|
|
104
|
+
var style = typeof el.style === 'string'
|
|
105
|
+
? formats.time[el.style]
|
|
106
|
+
: icu_messageformat_parser_1.isDateTimeSkeleton(el.style)
|
|
107
|
+
? el.style.parsedOptions
|
|
108
|
+
: undefined;
|
|
109
|
+
result.push({
|
|
110
|
+
type: PART_TYPE.literal,
|
|
111
|
+
value: formatters
|
|
112
|
+
.getDateTimeFormat(locales, style)
|
|
113
|
+
.format(value),
|
|
114
|
+
});
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (icu_messageformat_parser_1.isNumberElement(el)) {
|
|
118
|
+
var style = typeof el.style === 'string'
|
|
119
|
+
? formats.number[el.style]
|
|
120
|
+
: icu_messageformat_parser_1.isNumberSkeleton(el.style)
|
|
121
|
+
? el.style.parsedOptions
|
|
122
|
+
: undefined;
|
|
123
|
+
if (style && style.scale) {
|
|
124
|
+
value =
|
|
125
|
+
value *
|
|
126
|
+
(style.scale || 1);
|
|
127
|
+
}
|
|
128
|
+
result.push({
|
|
129
|
+
type: PART_TYPE.literal,
|
|
130
|
+
value: formatters
|
|
131
|
+
.getNumberFormat(locales, style)
|
|
132
|
+
.format(value),
|
|
133
|
+
});
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (icu_messageformat_parser_1.isTagElement(el)) {
|
|
137
|
+
var children = el.children, value_1 = el.value;
|
|
138
|
+
var formatFn = values[value_1];
|
|
139
|
+
if (!isFormatXMLElementFn(formatFn)) {
|
|
140
|
+
throw new error_1.InvalidValueTypeError(value_1, 'function', originalMessage);
|
|
141
|
+
}
|
|
142
|
+
var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);
|
|
143
|
+
var chunks = formatFn(parts.map(function (p) { return p.value; }));
|
|
144
|
+
if (!Array.isArray(chunks)) {
|
|
145
|
+
chunks = [chunks];
|
|
146
|
+
}
|
|
147
|
+
result.push.apply(result, chunks.map(function (c) {
|
|
148
|
+
return {
|
|
149
|
+
type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,
|
|
150
|
+
value: c,
|
|
151
|
+
};
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
if (icu_messageformat_parser_1.isSelectElement(el)) {
|
|
155
|
+
var opt = el.options[value] || el.options.other;
|
|
156
|
+
if (!opt) {
|
|
157
|
+
throw new error_1.InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
158
|
+
}
|
|
159
|
+
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (icu_messageformat_parser_1.isPluralElement(el)) {
|
|
163
|
+
var opt = el.options["=" + value];
|
|
164
|
+
if (!opt) {
|
|
165
|
+
if (!Intl.PluralRules) {
|
|
166
|
+
throw new error_1.FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", error_1.ErrorCode.MISSING_INTL_API, originalMessage);
|
|
167
|
+
}
|
|
168
|
+
var rule = formatters
|
|
169
|
+
.getPluralRules(locales, { type: el.pluralType })
|
|
170
|
+
.select(value - (el.offset || 0));
|
|
171
|
+
opt = el.options[rule] || el.options.other;
|
|
172
|
+
}
|
|
173
|
+
if (!opt) {
|
|
174
|
+
throw new error_1.InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
175
|
+
}
|
|
176
|
+
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return mergeLiteral(result);
|
|
181
|
+
}
|
|
182
|
+
exports.formatToParts = formatToParts;
|
package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// MIT License
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2021 FormatJS
|
|
4
|
+
//
|
|
5
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
//
|
|
7
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
//
|
|
9
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
|
+
|
|
11
|
+
import { Location } from './types';
|
|
12
|
+
export interface ParserError {
|
|
13
|
+
kind: ErrorKind;
|
|
14
|
+
message: string;
|
|
15
|
+
location: Location;
|
|
16
|
+
}
|
|
17
|
+
export declare enum ErrorKind {
|
|
18
|
+
/** Argument is unclosed (e.g. `{0`) */
|
|
19
|
+
EXPECT_ARGUMENT_CLOSING_BRACE = 1,
|
|
20
|
+
/** Argument is empty (e.g. `{}`). */
|
|
21
|
+
EMPTY_ARGUMENT = 2,
|
|
22
|
+
/** Argument is malformed (e.g. `{foo!}``) */
|
|
23
|
+
MALFORMED_ARGUMENT = 3,
|
|
24
|
+
/** Expect an argument type (e.g. `{foo,}`) */
|
|
25
|
+
EXPECT_ARGUMENT_TYPE = 4,
|
|
26
|
+
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
27
|
+
INVALID_ARGUMENT_TYPE = 5,
|
|
28
|
+
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
29
|
+
EXPECT_ARGUMENT_STYLE = 6,
|
|
30
|
+
/** The number skeleton is invalid. */
|
|
31
|
+
INVALID_NUMBER_SKELETON = 7,
|
|
32
|
+
/** The date time skeleton is invalid. */
|
|
33
|
+
INVALID_DATE_TIME_SKELETON = 8,
|
|
34
|
+
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
35
|
+
EXPECT_NUMBER_SKELETON = 9,
|
|
36
|
+
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
37
|
+
EXPECT_DATE_TIME_SKELETON = 10,
|
|
38
|
+
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
39
|
+
UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11,
|
|
40
|
+
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
41
|
+
EXPECT_SELECT_ARGUMENT_OPTIONS = 12,
|
|
42
|
+
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
43
|
+
EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13,
|
|
44
|
+
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
45
|
+
INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14,
|
|
46
|
+
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
47
|
+
EXPECT_SELECT_ARGUMENT_SELECTOR = 15,
|
|
48
|
+
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
49
|
+
EXPECT_PLURAL_ARGUMENT_SELECTOR = 16,
|
|
50
|
+
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
51
|
+
EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17,
|
|
52
|
+
/**
|
|
53
|
+
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
54
|
+
* (e.g. `{foo, plural, one}`)
|
|
55
|
+
*/
|
|
56
|
+
EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18,
|
|
57
|
+
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
58
|
+
INVALID_PLURAL_ARGUMENT_SELECTOR = 19,
|
|
59
|
+
/**
|
|
60
|
+
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
61
|
+
* (e.g. {foo, plural, one {#} one {#}})
|
|
62
|
+
*/
|
|
63
|
+
DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20,
|
|
64
|
+
/** Duplicate selectors in `select` argument.
|
|
65
|
+
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
66
|
+
*/
|
|
67
|
+
DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21,
|
|
68
|
+
/** Plural or select argument option must have `other` clause. */
|
|
69
|
+
MISSING_OTHER_CLAUSE = 22,
|
|
70
|
+
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
71
|
+
INVALID_TAG = 23,
|
|
72
|
+
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
73
|
+
INVALID_TAG_NAME = 25,
|
|
74
|
+
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
75
|
+
UNMATCHED_CLOSING_TAG = 26,
|
|
76
|
+
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
77
|
+
UNCLOSED_TAG = 27
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=error.d.ts.map
|
package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// MIT License
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2021 FormatJS
|
|
4
|
+
//
|
|
5
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
//
|
|
7
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
//
|
|
9
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
|
+
|
|
11
|
+
import { ParserOptions } from './parser';
|
|
12
|
+
import { MessageFormatElement } from './types';
|
|
13
|
+
export declare function parse(message: string, opts?: ParserOptions): MessageFormatElement[];
|
|
14
|
+
export * from './types';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|