chrome-devtools-frontend 1.0.968254 → 1.0.970302

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.
Files changed (65) hide show
  1. package/config/gni/devtools_grd_files.gni +64 -0
  2. package/front_end/core/i18n/locales/en-US.json +18 -0
  3. package/front_end/core/i18n/locales/en-XL.json +18 -0
  4. package/front_end/core/sdk/CSSMatchedStyles.ts +1 -1
  5. package/front_end/core/sdk/ChildTargetManager.ts +2 -2
  6. package/front_end/core/sdk/Connections.ts +6 -1
  7. package/front_end/core/sdk/NetworkManager.ts +4 -3
  8. package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +84 -13
  9. package/front_end/models/persistence/NetworkPersistenceManager.ts +205 -41
  10. package/front_end/models/timeline_model/TimelineFrameModel.ts +21 -7
  11. package/front_end/panels/animation/animationTimeline.css +0 -3
  12. package/front_end/panels/application/components/ReportsGrid.ts +19 -4
  13. package/front_end/panels/application/components/trustTokensViewDeleteButton.css +0 -1
  14. package/front_end/panels/console/consolePinPane.css +0 -17
  15. package/front_end/panels/css_overview/cssOverviewCompletedView.css +0 -1
  16. package/front_end/panels/elements/components/adornerSettingsPane.css +0 -1
  17. package/front_end/panels/elements/components/computedStyleTrace.css +1 -1
  18. package/front_end/panels/elements/components/elementsBreadcrumbs.css +0 -1
  19. package/front_end/panels/elements/computedStyleWidgetTree.css +2 -2
  20. package/front_end/panels/elements/elementsTreeOutline.css +0 -2
  21. package/front_end/panels/emulation/deviceModeView.css +0 -1
  22. package/front_end/panels/event_listeners/eventListenersView.css +0 -1
  23. package/front_end/panels/issues/components/hideIssuesMenu.css +0 -1
  24. package/front_end/panels/lighthouse/LighthouseController.ts +25 -1
  25. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +37 -5
  26. package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -0
  27. package/front_end/panels/lighthouse/LighthouseStatusView.ts +5 -5
  28. package/front_end/panels/media/playerListView.css +0 -1
  29. package/front_end/panels/network/networkLogView.css +0 -4
  30. package/front_end/panels/network/requestPayloadTree.css +0 -2
  31. package/front_end/panels/network/signedExchangeInfoTree.css +0 -1
  32. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -4
  33. package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -1
  34. package/front_end/panels/sources/CSSPlugin.ts +2 -0
  35. package/front_end/panels/sources/ScopeChainSidebarPane.ts +31 -0
  36. package/front_end/panels/sources/SourceMapNamesResolver.ts +15 -9
  37. package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
  38. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +75 -3
  39. package/front_end/panels/webauthn/webauthnPane.css +0 -12
  40. package/front_end/services/puppeteer/PuppeteerConnection.ts +107 -0
  41. package/front_end/services/puppeteer/puppeteer.ts +9 -0
  42. package/front_end/third_party/codemirror/package/addon/fold/foldgutter.css +1 -5
  43. package/front_end/third_party/codemirror.next/README.chromium +10 -0
  44. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  45. package/front_end/third_party/codemirror.next/chunk/cpp.js +2 -1
  46. package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -2
  47. package/front_end/third_party/codemirror.next/chunk/python.js +2 -1
  48. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +574 -553
  49. package/front_end/third_party/codemirror.next/package.json +11 -11
  50. package/front_end/ui/components/adorners/adorner.css +0 -4
  51. package/front_end/ui/components/buttons/button.css +0 -4
  52. package/front_end/ui/components/data_grid/dataGrid.css +0 -4
  53. package/front_end/ui/components/icon_button/iconButton.css +0 -1
  54. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
  55. package/front_end/ui/legacy/TabbedPane.ts +1 -1
  56. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
  57. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -2
  58. package/front_end/ui/legacy/tabbedPane.css +0 -4
  59. package/front_end/ui/legacy/textButton.css +0 -1
  60. package/front_end/ui/legacy/toolbar.css +0 -1
  61. package/package.json +2 -2
  62. package/scripts/build/devtools_plugin.js +32 -1
  63. package/scripts/build/esbuild.js +1 -24
  64. package/scripts/build/tests/plugins_test.js +60 -1
  65. package/scripts/hosted_mode/server.js +5 -0
@@ -2652,7 +2652,7 @@ declare class EditorView {
2652
2652
  (`view.contentDOM.getBoundingClientRect().top`) to limit layout
2653
2653
  queries.
2654
2654
 
2655
- *Deprecated: use `blockAtHeight` instead.*
2655
+ *Deprecated: use `elementAtHeight` instead.*
2656
2656
  */
2657
2657
  blockAtHeight(height: number, docTop?: number): BlockInfo;
2658
2658
  /**
@@ -4384,420 +4384,6 @@ declare namespace _codemirror_lang_cpp {
4384
4384
  };
4385
4385
  }
4386
4386
 
4387
- /**
4388
- Encapsulates a single line of input. Given to stream syntax code,
4389
- which uses it to tokenize the content.
4390
- */
4391
- declare class StringStream {
4392
- /**
4393
- The line.
4394
- */
4395
- string: string;
4396
- private tabSize;
4397
- /**
4398
- The current indent unit size.
4399
- */
4400
- indentUnit: number;
4401
- /**
4402
- The current position on the line.
4403
- */
4404
- pos: number;
4405
- /**
4406
- The start position of the current token.
4407
- */
4408
- start: number;
4409
- private lastColumnPos;
4410
- private lastColumnValue;
4411
- /**
4412
- True if we are at the end of the line.
4413
- */
4414
- eol(): boolean;
4415
- /**
4416
- True if we are at the start of the line.
4417
- */
4418
- sol(): boolean;
4419
- /**
4420
- Get the next code unit after the current position, or undefined
4421
- if we're at the end of the line.
4422
- */
4423
- peek(): string | undefined;
4424
- /**
4425
- Read the next code unit and advance `this.pos`.
4426
- */
4427
- next(): string | void;
4428
- /**
4429
- Match the next character against the given string, regular
4430
- expression, or predicate. Consume and return it if it matches.
4431
- */
4432
- eat(match: string | RegExp | ((ch: string) => boolean)): string | void;
4433
- /**
4434
- Continue matching characters that match the given string,
4435
- regular expression, or predicate function. Return true if any
4436
- characters were consumed.
4437
- */
4438
- eatWhile(match: string | RegExp | ((ch: string) => boolean)): boolean;
4439
- /**
4440
- Consume whitespace ahead of `this.pos`. Return true if any was
4441
- found.
4442
- */
4443
- eatSpace(): boolean;
4444
- /**
4445
- Move to the end of the line.
4446
- */
4447
- skipToEnd(): void;
4448
- /**
4449
- Move to directly before the given character, if found on the
4450
- current line.
4451
- */
4452
- skipTo(ch: string): boolean | void;
4453
- /**
4454
- Move back `n` characters.
4455
- */
4456
- backUp(n: number): void;
4457
- /**
4458
- Get the column position at `this.pos`.
4459
- */
4460
- column(): number;
4461
- /**
4462
- Get the indentation column of the current line.
4463
- */
4464
- indentation(): number;
4465
- /**
4466
- Match the input against the given string or regular expression
4467
- (which should start with a `^`). Return true or the regexp match
4468
- if it matches.
4469
-
4470
- Unless `consume` is set to `false`, this will move `this.pos`
4471
- past the matched text.
4472
-
4473
- When matching a string `caseInsensitive` can be set to true to
4474
- make the match case-insensitive.
4475
- */
4476
- match(pattern: string | RegExp, consume?: boolean, caseInsensitive?: boolean): boolean | RegExpMatchArray | null;
4477
- /**
4478
- Get the current token.
4479
- */
4480
- current(): string;
4481
- }
4482
-
4483
- /**
4484
- A stream parser parses or tokenizes content from start to end,
4485
- emitting tokens as it goes over it. It keeps a mutable (but
4486
- copyable) object with state, in which it can store information
4487
- about the current context.
4488
- */
4489
- interface StreamParser<State> {
4490
- /**
4491
- Read one token, advancing the stream past it, and returning a
4492
- string indicating the token's style tag—either the name of one
4493
- of the tags in [`tags`](https://codemirror.net/6/docs/ref/#highlight.tags), or such a name
4494
- suffixed by one or more tag
4495
- [modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) names, separated by
4496
- spaces. For example `"keyword"` or "`variableName.constant"`.
4497
-
4498
- It is okay to return a zero-length token, but only if that
4499
- updates the state so that the next call will return a non-empty
4500
- token again.
4501
- */
4502
- token(stream: StringStream, state: State): string | null;
4503
- /**
4504
- This notifies the parser of a blank line in the input. It can
4505
- update its state here if it needs to.
4506
- */
4507
- blankLine?(state: State, indentUnit: number): void;
4508
- /**
4509
- Produce a start state for the parser.
4510
- */
4511
- startState?(indentUnit: number): State;
4512
- /**
4513
- Copy a given state. By default, a shallow object copy is done
4514
- which also copies arrays held at the top level of the object.
4515
- */
4516
- copyState?(state: State): State;
4517
- /**
4518
- Compute automatic indentation for the line that starts with the
4519
- given state and text.
4520
- */
4521
- indent?(state: State, textAfter: string, context: IndentContext): number | null;
4522
- /**
4523
- Default [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) to
4524
- attach to this language.
4525
- */
4526
- languageData?: {
4527
- [name: string]: any;
4528
- };
4529
- }
4530
- /**
4531
- A [language](https://codemirror.net/6/docs/ref/#language.Language) class based on a streaming
4532
- parser.
4533
- */
4534
- declare class StreamLanguage<State> extends Language {
4535
- private constructor();
4536
- static define<State>(spec: StreamParser<State>): StreamLanguage<State>;
4537
- private getIndent;
4538
- get allowsNesting(): boolean;
4539
- }
4540
-
4541
- /**
4542
- Extension to enable bracket-closing behavior. When a closeable
4543
- bracket is typed, its closing bracket is immediately inserted
4544
- after the cursor. When closing a bracket directly in front of a
4545
- closing bracket inserted by the extension, the cursor moves over
4546
- that bracket.
4547
- */
4548
- declare function closeBrackets(): Extension;
4549
- /**
4550
- Close-brackets related key bindings. Binds Backspace to
4551
- [`deleteBracketPair`](https://codemirror.net/6/docs/ref/#closebrackets.deleteBracketPair).
4552
- */
4553
- declare const closeBracketsKeymap: readonly KeyBinding[];
4554
-
4555
- /**
4556
- Move the selection one group or camel-case subword forward.
4557
- */
4558
- declare const cursorSubwordForward: Command;
4559
- /**
4560
- Move the selection one group or camel-case subword backward.
4561
- */
4562
- declare const cursorSubwordBackward: Command;
4563
- /**
4564
- Move the selection to the bracket matching the one it is currently
4565
- on, if any.
4566
- */
4567
- declare const cursorMatchingBracket: StateCommand;
4568
- /**
4569
- Extend the selection to the bracket matching the one the selection
4570
- head is currently on, if any.
4571
- */
4572
- declare const selectMatchingBracket: StateCommand;
4573
- /**
4574
- Move the selection head one group or camel-case subword forward.
4575
- */
4576
- declare const selectSubwordForward: Command;
4577
- /**
4578
- Move the selection head one group or subword backward.
4579
- */
4580
- declare const selectSubwordBackward: Command;
4581
- /**
4582
- Replace the selection with a newline and indent the newly created
4583
- line(s). If the current line consists only of whitespace, this
4584
- will also delete that whitespace. When the cursor is between
4585
- matching brackets, an additional newline will be inserted after
4586
- the cursor.
4587
- */
4588
- declare const insertNewlineAndIndent: StateCommand;
4589
- /**
4590
- Add a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation to all selected
4591
- lines.
4592
- */
4593
- declare const indentMore: StateCommand;
4594
- /**
4595
- Remove a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation from all
4596
- selected lines.
4597
- */
4598
- declare const indentLess: StateCommand;
4599
- /**
4600
- An array of key bindings closely sticking to platform-standard or
4601
- widely used bindings. (This includes the bindings from
4602
- [`emacsStyleKeymap`](https://codemirror.net/6/docs/ref/#commands.emacsStyleKeymap), with their `key`
4603
- property changed to `mac`.)
4604
-
4605
- - ArrowLeft: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift)
4606
- - ArrowRight: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift)
4607
- - Ctrl-ArrowLeft (Alt-ArrowLeft on macOS): [`cursorGroupLeft`](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) ([`selectGroupLeft`](https://codemirror.net/6/docs/ref/#commands.selectGroupLeft) with Shift)
4608
- - Ctrl-ArrowRight (Alt-ArrowRight on macOS): [`cursorGroupRight`](https://codemirror.net/6/docs/ref/#commands.cursorGroupRight) ([`selectGroupRight`](https://codemirror.net/6/docs/ref/#commands.selectGroupRight) with Shift)
4609
- - Cmd-ArrowLeft (on macOS): [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift)
4610
- - Cmd-ArrowRight (on macOS): [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift)
4611
- - ArrowUp: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift)
4612
- - ArrowDown: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift)
4613
- - Cmd-ArrowUp (on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)
4614
- - Cmd-ArrowDown (on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)
4615
- - Ctrl-ArrowUp (on macOS): [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)
4616
- - Ctrl-ArrowDown (on macOS): [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)
4617
- - PageUp: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)
4618
- - PageDown: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)
4619
- - Home: [`cursorLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryBackward) ([`selectLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryBackward) with Shift)
4620
- - End: [`cursorLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryForward) ([`selectLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryForward) with Shift)
4621
- - Ctrl-Home (Cmd-Home on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)
4622
- - Ctrl-End (Cmd-Home on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)
4623
- - Enter: [`insertNewlineAndIndent`](https://codemirror.net/6/docs/ref/#commands.insertNewlineAndIndent)
4624
- - Ctrl-a (Cmd-a on macOS): [`selectAll`](https://codemirror.net/6/docs/ref/#commands.selectAll)
4625
- - Backspace: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward)
4626
- - Delete: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward)
4627
- - Ctrl-Backspace (Alt-Backspace on macOS): [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward)
4628
- - Ctrl-Delete (Alt-Delete on macOS): [`deleteGroupForward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupForward)
4629
- - Cmd-Backspace (macOS): [`deleteToLineStart`](https://codemirror.net/6/docs/ref/#commands.deleteToLineStart).
4630
- - Cmd-Delete (macOS): [`deleteToLineEnd`](https://codemirror.net/6/docs/ref/#commands.deleteToLineEnd).
4631
- */
4632
- declare const standardKeymap: readonly KeyBinding[];
4633
-
4634
- /**
4635
- Comment or uncomment the current selection. Will use line comments
4636
- if available, otherwise falling back to block comments.
4637
- */
4638
- declare const toggleComment: StateCommand;
4639
-
4640
- /**
4641
- Default fold-related key bindings.
4642
-
4643
- - Ctrl-Shift-[ (Cmd-Alt-[ on macOS): [`foldCode`](https://codemirror.net/6/docs/ref/#fold.foldCode).
4644
- - Ctrl-Shift-] (Cmd-Alt-] on macOS): [`unfoldCode`](https://codemirror.net/6/docs/ref/#fold.unfoldCode).
4645
- - Ctrl-Alt-[: [`foldAll`](https://codemirror.net/6/docs/ref/#fold.foldAll).
4646
- - Ctrl-Alt-]: [`unfoldAll`](https://codemirror.net/6/docs/ref/#fold.unfoldAll).
4647
- */
4648
- declare const foldKeymap: readonly KeyBinding[];
4649
- interface FoldConfig {
4650
- /**
4651
- A function that creates the DOM element used to indicate the
4652
- position of folded code. The `onclick` argument is the default
4653
- click event handler, which toggles folding on the line that
4654
- holds the element, and should probably be added as an event
4655
- handler to the returned element.
4656
-
4657
- When this option isn't given, the `placeholderText` option will
4658
- be used to create the placeholder element.
4659
- */
4660
- placeholderDOM?: ((view: EditorView, onclick: (event: Event) => void) => HTMLElement) | null;
4661
- /**
4662
- Text to use as placeholder for folded text. Defaults to `"…"`.
4663
- Will be styled with the `"cm-foldPlaceholder"` class.
4664
- */
4665
- placeholderText?: string;
4666
- }
4667
- /**
4668
- Create an extension that configures code folding.
4669
- */
4670
- declare function codeFolding(config?: FoldConfig): Extension;
4671
- interface FoldGutterConfig {
4672
- /**
4673
- A function that creates the DOM element used to indicate a
4674
- given line is folded or can be folded.
4675
- When not given, the `openText`/`closeText` option will be used instead.
4676
- */
4677
- markerDOM?: ((open: boolean) => HTMLElement) | null;
4678
- /**
4679
- Text used to indicate that a given line can be folded.
4680
- Defaults to `"⌄"`.
4681
- */
4682
- openText?: string;
4683
- /**
4684
- Text used to indicate that a given line is folded.
4685
- Defaults to `"›"`.
4686
- */
4687
- closedText?: string;
4688
- }
4689
- /**
4690
- Create an extension that registers a fold gutter, which shows a
4691
- fold status indicator before foldable lines (which can be clicked
4692
- to fold or unfold the line).
4693
- */
4694
- declare function foldGutter(config?: FoldGutterConfig): Extension;
4695
-
4696
- /**
4697
- A gutter marker represents a bit of information attached to a line
4698
- in a specific gutter. Your own custom markers have to extend this
4699
- class.
4700
- */
4701
- declare abstract class GutterMarker extends RangeValue {
4702
- /**
4703
- Compare this marker to another marker of the same type.
4704
- */
4705
- eq(other: GutterMarker): boolean;
4706
- /**
4707
- Render the DOM node for this marker, if any.
4708
- */
4709
- toDOM?(_view: EditorView): Node;
4710
- /**
4711
- This property can be used to add CSS classes to the gutter
4712
- element that contains this marker.
4713
- */
4714
- elementClass: string;
4715
- /**
4716
- Called if the marker has a `toDOM` method and its representation
4717
- was removed from a gutter.
4718
- */
4719
- destroy(dom: Node): void;
4720
- }
4721
- declare type Handlers = {
4722
- [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
4723
- };
4724
- interface GutterConfig {
4725
- /**
4726
- An extra CSS class to be added to the wrapper (`cm-gutter`)
4727
- element.
4728
- */
4729
- class?: string;
4730
- /**
4731
- Controls whether empty gutter elements should be rendered.
4732
- Defaults to false.
4733
- */
4734
- renderEmptyElements?: boolean;
4735
- /**
4736
- Retrieve a set of markers to use in this gutter.
4737
- */
4738
- markers?: (view: EditorView) => (RangeSet<GutterMarker> | readonly RangeSet<GutterMarker>[]);
4739
- /**
4740
- Can be used to optionally add a single marker to every line.
4741
- */
4742
- lineMarker?: (view: EditorView, line: BlockInfo, otherMarkers: readonly GutterMarker[]) => GutterMarker | null;
4743
- /**
4744
- If line markers depend on additional state, and should be
4745
- updated when that changes, pass a predicate here that checks
4746
- whether a given view update might change the line markers.
4747
- */
4748
- lineMarkerChange?: null | ((update: ViewUpdate) => boolean);
4749
- /**
4750
- Add a hidden spacer element that gives the gutter its base
4751
- width.
4752
- */
4753
- initialSpacer?: null | ((view: EditorView) => GutterMarker);
4754
- /**
4755
- Update the spacer element when the view is updated.
4756
- */
4757
- updateSpacer?: null | ((spacer: GutterMarker, update: ViewUpdate) => GutterMarker);
4758
- /**
4759
- Supply event handlers for DOM events on this gutter.
4760
- */
4761
- domEventHandlers?: Handlers;
4762
- }
4763
- /**
4764
- Define an editor gutter. The order in which the gutters appear is
4765
- determined by their extension priority.
4766
- */
4767
- declare function gutter(config: GutterConfig): Extension;
4768
- /**
4769
- The gutter-drawing plugin is automatically enabled when you add a
4770
- gutter, but you can use this function to explicitly configure it.
4771
-
4772
- Unless `fixed` is explicitly set to `false`, the gutters are
4773
- fixed, meaning they don't scroll along with the content
4774
- horizontally (except on Internet Explorer, which doesn't support
4775
- CSS [`position:
4776
- sticky`](https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky)).
4777
- */
4778
- declare function gutters(config?: {
4779
- fixed?: boolean;
4780
- }): Extension;
4781
- interface LineNumberConfig {
4782
- /**
4783
- How to display line numbers. Defaults to simply converting them
4784
- to string.
4785
- */
4786
- formatNumber?: (lineNo: number, state: EditorState) => string;
4787
- /**
4788
- Supply event handlers for DOM events on this gutter.
4789
- */
4790
- domEventHandlers?: Handlers;
4791
- }
4792
- /**
4793
- Facet used to provide markers to the line number gutter.
4794
- */
4795
- declare const lineNumberMarkers: Facet<RangeSet<GutterMarker>, readonly RangeSet<GutterMarker>[]>;
4796
- /**
4797
- Create a line number gutter extension.
4798
- */
4799
- declare function lineNumbers(config?: LineNumberConfig): Extension;
4800
-
4801
4387
  /**
4802
4388
  Highlighting tags are markers that denote a highlighting category.
4803
4389
  They are [associated](https://codemirror.net/6/docs/ref/#highlight.styleTags) with parts of a syntax
@@ -5104,254 +4690,683 @@ declare const tags: {
5104
4690
  The [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) for the self or this
5105
4691
  object.
5106
4692
  */
5107
- self: Tag;
4693
+ self: Tag;
4694
+ /**
4695
+ The [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) for null.
4696
+ */
4697
+ null: Tag;
4698
+ /**
4699
+ A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) denoting some atomic value.
4700
+ */
4701
+ atom: Tag;
4702
+ /**
4703
+ A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that represents a unit.
4704
+ */
4705
+ unit: Tag;
4706
+ /**
4707
+ A modifier [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword).
4708
+ */
4709
+ modifier: Tag;
4710
+ /**
4711
+ A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that acts as an operator.
4712
+ */
4713
+ operatorKeyword: Tag;
4714
+ /**
4715
+ A control-flow related [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword).
4716
+ */
4717
+ controlKeyword: Tag;
4718
+ /**
4719
+ A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that defines something.
4720
+ */
4721
+ definitionKeyword: Tag;
4722
+ /**
4723
+ A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) related to defining or
4724
+ interfacing with modules.
4725
+ */
4726
+ moduleKeyword: Tag;
4727
+ /**
4728
+ An operator.
4729
+ */
4730
+ operator: Tag;
4731
+ /**
4732
+ An [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that defines something.
4733
+ */
4734
+ derefOperator: Tag;
4735
+ /**
4736
+ Arithmetic-related [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4737
+ */
4738
+ arithmeticOperator: Tag;
4739
+ /**
4740
+ Logical [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4741
+ */
4742
+ logicOperator: Tag;
4743
+ /**
4744
+ Bit [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4745
+ */
4746
+ bitwiseOperator: Tag;
4747
+ /**
4748
+ Comparison [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4749
+ */
4750
+ compareOperator: Tag;
4751
+ /**
4752
+ [Operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that updates its operand.
4753
+ */
4754
+ updateOperator: Tag;
4755
+ /**
4756
+ [Operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that defines something.
4757
+ */
4758
+ definitionOperator: Tag;
4759
+ /**
4760
+ Type-related [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4761
+ */
4762
+ typeOperator: Tag;
4763
+ /**
4764
+ Control-flow [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4765
+ */
4766
+ controlOperator: Tag;
4767
+ /**
4768
+ Program or markup punctuation.
4769
+ */
4770
+ punctuation: Tag;
4771
+ /**
4772
+ [Punctuation](https://codemirror.net/6/docs/ref/#highlight.tags.punctuation) that separates
4773
+ things.
4774
+ */
4775
+ separator: Tag;
4776
+ /**
4777
+ Bracket-style [punctuation](https://codemirror.net/6/docs/ref/#highlight.tags.punctuation).
4778
+ */
4779
+ bracket: Tag;
4780
+ /**
4781
+ Angle [brackets](https://codemirror.net/6/docs/ref/#highlight.tags.bracket) (usually `<` and `>`
4782
+ tokens).
4783
+ */
4784
+ angleBracket: Tag;
4785
+ /**
4786
+ Square [brackets](https://codemirror.net/6/docs/ref/#highlight.tags.bracket) (usually `[` and `]`
4787
+ tokens).
4788
+ */
4789
+ squareBracket: Tag;
4790
+ /**
4791
+ Parentheses (usually `(` and `)` tokens). Subtag of
4792
+ [bracket](https://codemirror.net/6/docs/ref/#highlight.tags.bracket).
4793
+ */
4794
+ paren: Tag;
4795
+ /**
4796
+ Braces (usually `{` and `}` tokens). Subtag of
4797
+ [bracket](https://codemirror.net/6/docs/ref/#highlight.tags.bracket).
4798
+ */
4799
+ brace: Tag;
4800
+ /**
4801
+ Content, for example plain text in XML or markup documents.
4802
+ */
4803
+ content: Tag;
4804
+ /**
4805
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a heading.
4806
+ */
4807
+ heading: Tag;
4808
+ /**
4809
+ A level 1 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
4810
+ */
4811
+ heading1: Tag;
4812
+ /**
4813
+ A level 2 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
4814
+ */
4815
+ heading2: Tag;
4816
+ /**
4817
+ A level 3 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
4818
+ */
4819
+ heading3: Tag;
4820
+ /**
4821
+ A level 4 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
4822
+ */
4823
+ heading4: Tag;
4824
+ /**
4825
+ A level 5 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
4826
+ */
4827
+ heading5: Tag;
4828
+ /**
4829
+ A level 6 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
4830
+ */
4831
+ heading6: Tag;
4832
+ /**
4833
+ A prose separator (such as a horizontal rule).
4834
+ */
4835
+ contentSeparator: Tag;
4836
+ /**
4837
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a list.
4838
+ */
4839
+ list: Tag;
4840
+ /**
4841
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a quote.
4842
+ */
4843
+ quote: Tag;
4844
+ /**
4845
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is emphasized.
4846
+ */
4847
+ emphasis: Tag;
4848
+ /**
4849
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is styled strong.
4850
+ */
4851
+ strong: Tag;
4852
+ /**
4853
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is part of a link.
4854
+ */
4855
+ link: Tag;
4856
+ /**
4857
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is styled as code or
4858
+ monospace.
4859
+ */
4860
+ monospace: Tag;
4861
+ /**
4862
+ [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that has a strike-through
4863
+ style.
4864
+ */
4865
+ strikethrough: Tag;
4866
+ /**
4867
+ Inserted text in a change-tracking format.
4868
+ */
4869
+ inserted: Tag;
4870
+ /**
4871
+ Deleted text.
4872
+ */
4873
+ deleted: Tag;
4874
+ /**
4875
+ Changed text.
4876
+ */
4877
+ changed: Tag;
4878
+ /**
4879
+ An invalid or unsyntactic element.
4880
+ */
4881
+ invalid: Tag;
5108
4882
  /**
5109
- The [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) for null.
4883
+ Metadata or meta-instruction.
5110
4884
  */
5111
- null: Tag;
4885
+ meta: Tag;
5112
4886
  /**
5113
- A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) denoting some atomic value.
4887
+ [Metadata](https://codemirror.net/6/docs/ref/#highlight.tags.meta) that applies to the entire
4888
+ document.
5114
4889
  */
5115
- atom: Tag;
4890
+ documentMeta: Tag;
5116
4891
  /**
5117
- A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that represents a unit.
4892
+ [Metadata](https://codemirror.net/6/docs/ref/#highlight.tags.meta) that annotates or adds
4893
+ attributes to a given syntactic element.
5118
4894
  */
5119
- unit: Tag;
4895
+ annotation: Tag;
5120
4896
  /**
5121
- A modifier [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword).
4897
+ Processing instruction or preprocessor directive. Subtag of
4898
+ [meta](https://codemirror.net/6/docs/ref/#highlight.tags.meta).
5122
4899
  */
5123
- modifier: Tag;
4900
+ processingInstruction: Tag;
5124
4901
  /**
5125
- A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that acts as an operator.
4902
+ [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates that a
4903
+ given element is being defined. Expected to be used with the
4904
+ various [name](https://codemirror.net/6/docs/ref/#highlight.tags.name) tags.
5126
4905
  */
5127
- operatorKeyword: Tag;
4906
+ definition: (tag: Tag) => Tag;
5128
4907
  /**
5129
- A control-flow related [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword).
4908
+ [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates that
4909
+ something is constant. Mostly expected to be used with
4910
+ [variable names](https://codemirror.net/6/docs/ref/#highlight.tags.variableName).
5130
4911
  */
5131
- controlKeyword: Tag;
4912
+ constant: (tag: Tag) => Tag;
5132
4913
  /**
5133
- A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that defines something.
4914
+ [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) used to indicate that
4915
+ a [variable](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) or [property
4916
+ name](https://codemirror.net/6/docs/ref/#highlight.tags.propertyName) is being called or defined
4917
+ as a function.
5134
4918
  */
5135
- definitionKeyword: Tag;
4919
+ function: (tag: Tag) => Tag;
5136
4920
  /**
5137
- A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) related to defining or
5138
- interfacing with modules.
4921
+ [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that can be applied to
4922
+ [names](https://codemirror.net/6/docs/ref/#highlight.tags.name) to indicate that they belong to
4923
+ the language's standard environment.
5139
4924
  */
5140
- moduleKeyword: Tag;
4925
+ standard: (tag: Tag) => Tag;
5141
4926
  /**
5142
- An operator.
4927
+ [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates a given
4928
+ [names](https://codemirror.net/6/docs/ref/#highlight.tags.name) is local to some scope.
5143
4929
  */
5144
- operator: Tag;
4930
+ local: (tag: Tag) => Tag;
5145
4931
  /**
5146
- An [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that defines something.
4932
+ A generic variant [modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that
4933
+ can be used to tag language-specific alternative variants of
4934
+ some common tag. It is recommended for themes to define special
4935
+ forms of at least the [string](https://codemirror.net/6/docs/ref/#highlight.tags.string) and
4936
+ [variable name](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) tags, since those
4937
+ come up a lot.
5147
4938
  */
5148
- derefOperator: Tag;
4939
+ special: (tag: Tag) => Tag;
4940
+ };
4941
+
4942
+ /**
4943
+ Encapsulates a single line of input. Given to stream syntax code,
4944
+ which uses it to tokenize the content.
4945
+ */
4946
+ declare class StringStream {
5149
4947
  /**
5150
- Arithmetic-related [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4948
+ The line.
5151
4949
  */
5152
- arithmeticOperator: Tag;
4950
+ string: string;
4951
+ private tabSize;
5153
4952
  /**
5154
- Logical [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4953
+ The current indent unit size.
5155
4954
  */
5156
- logicOperator: Tag;
4955
+ indentUnit: number;
5157
4956
  /**
5158
- Bit [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4957
+ The current position on the line.
5159
4958
  */
5160
- bitwiseOperator: Tag;
4959
+ pos: number;
5161
4960
  /**
5162
- Comparison [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4961
+ The start position of the current token.
5163
4962
  */
5164
- compareOperator: Tag;
4963
+ start: number;
4964
+ private lastColumnPos;
4965
+ private lastColumnValue;
5165
4966
  /**
5166
- [Operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that updates its operand.
4967
+ True if we are at the end of the line.
5167
4968
  */
5168
- updateOperator: Tag;
4969
+ eol(): boolean;
5169
4970
  /**
5170
- [Operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that defines something.
4971
+ True if we are at the start of the line.
5171
4972
  */
5172
- definitionOperator: Tag;
4973
+ sol(): boolean;
5173
4974
  /**
5174
- Type-related [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4975
+ Get the next code unit after the current position, or undefined
4976
+ if we're at the end of the line.
5175
4977
  */
5176
- typeOperator: Tag;
4978
+ peek(): string | undefined;
5177
4979
  /**
5178
- Control-flow [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator).
4980
+ Read the next code unit and advance `this.pos`.
5179
4981
  */
5180
- controlOperator: Tag;
4982
+ next(): string | void;
5181
4983
  /**
5182
- Program or markup punctuation.
4984
+ Match the next character against the given string, regular
4985
+ expression, or predicate. Consume and return it if it matches.
5183
4986
  */
5184
- punctuation: Tag;
4987
+ eat(match: string | RegExp | ((ch: string) => boolean)): string | void;
5185
4988
  /**
5186
- [Punctuation](https://codemirror.net/6/docs/ref/#highlight.tags.punctuation) that separates
5187
- things.
4989
+ Continue matching characters that match the given string,
4990
+ regular expression, or predicate function. Return true if any
4991
+ characters were consumed.
5188
4992
  */
5189
- separator: Tag;
4993
+ eatWhile(match: string | RegExp | ((ch: string) => boolean)): boolean;
5190
4994
  /**
5191
- Bracket-style [punctuation](https://codemirror.net/6/docs/ref/#highlight.tags.punctuation).
4995
+ Consume whitespace ahead of `this.pos`. Return true if any was
4996
+ found.
5192
4997
  */
5193
- bracket: Tag;
4998
+ eatSpace(): boolean;
5194
4999
  /**
5195
- Angle [brackets](https://codemirror.net/6/docs/ref/#highlight.tags.bracket) (usually `<` and `>`
5196
- tokens).
5000
+ Move to the end of the line.
5197
5001
  */
5198
- angleBracket: Tag;
5002
+ skipToEnd(): void;
5199
5003
  /**
5200
- Square [brackets](https://codemirror.net/6/docs/ref/#highlight.tags.bracket) (usually `[` and `]`
5201
- tokens).
5004
+ Move to directly before the given character, if found on the
5005
+ current line.
5202
5006
  */
5203
- squareBracket: Tag;
5007
+ skipTo(ch: string): boolean | void;
5204
5008
  /**
5205
- Parentheses (usually `(` and `)` tokens). Subtag of
5206
- [bracket](https://codemirror.net/6/docs/ref/#highlight.tags.bracket).
5009
+ Move back `n` characters.
5207
5010
  */
5208
- paren: Tag;
5011
+ backUp(n: number): void;
5209
5012
  /**
5210
- Braces (usually `{` and `}` tokens). Subtag of
5211
- [bracket](https://codemirror.net/6/docs/ref/#highlight.tags.bracket).
5013
+ Get the column position at `this.pos`.
5212
5014
  */
5213
- brace: Tag;
5015
+ column(): number;
5214
5016
  /**
5215
- Content, for example plain text in XML or markup documents.
5017
+ Get the indentation column of the current line.
5216
5018
  */
5217
- content: Tag;
5019
+ indentation(): number;
5218
5020
  /**
5219
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a heading.
5021
+ Match the input against the given string or regular expression
5022
+ (which should start with a `^`). Return true or the regexp match
5023
+ if it matches.
5024
+
5025
+ Unless `consume` is set to `false`, this will move `this.pos`
5026
+ past the matched text.
5027
+
5028
+ When matching a string `caseInsensitive` can be set to true to
5029
+ make the match case-insensitive.
5220
5030
  */
5221
- heading: Tag;
5031
+ match(pattern: string | RegExp, consume?: boolean, caseInsensitive?: boolean): boolean | RegExpMatchArray | null;
5222
5032
  /**
5223
- A level 1 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
5033
+ Get the current token.
5224
5034
  */
5225
- heading1: Tag;
5035
+ current(): string;
5036
+ }
5037
+
5038
+ /**
5039
+ A stream parser parses or tokenizes content from start to end,
5040
+ emitting tokens as it goes over it. It keeps a mutable (but
5041
+ copyable) object with state, in which it can store information
5042
+ about the current context.
5043
+ */
5044
+ interface StreamParser<State> {
5226
5045
  /**
5227
- A level 2 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
5046
+ Read one token, advancing the stream past it, and returning a
5047
+ string indicating the token's style tag—either the name of one
5048
+ of the tags in [`tags`](https://codemirror.net/6/docs/ref/#highlight.tags), or such a name
5049
+ suffixed by one or more tag
5050
+ [modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) names, separated by
5051
+ spaces. For example `"keyword"` or "`variableName.constant"`.
5052
+
5053
+ It is okay to return a zero-length token, but only if that
5054
+ updates the state so that the next call will return a non-empty
5055
+ token again.
5228
5056
  */
5229
- heading2: Tag;
5057
+ token(stream: StringStream, state: State): string | null;
5230
5058
  /**
5231
- A level 3 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
5059
+ This notifies the parser of a blank line in the input. It can
5060
+ update its state here if it needs to.
5232
5061
  */
5233
- heading3: Tag;
5062
+ blankLine?(state: State, indentUnit: number): void;
5234
5063
  /**
5235
- A level 4 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
5064
+ Produce a start state for the parser.
5236
5065
  */
5237
- heading4: Tag;
5066
+ startState?(indentUnit: number): State;
5238
5067
  /**
5239
- A level 5 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
5068
+ Copy a given state. By default, a shallow object copy is done
5069
+ which also copies arrays held at the top level of the object.
5240
5070
  */
5241
- heading5: Tag;
5071
+ copyState?(state: State): State;
5242
5072
  /**
5243
- A level 6 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading).
5073
+ Compute automatic indentation for the line that starts with the
5074
+ given state and text.
5244
5075
  */
5245
- heading6: Tag;
5076
+ indent?(state: State, textAfter: string, context: IndentContext): number | null;
5246
5077
  /**
5247
- A prose separator (such as a horizontal rule).
5078
+ Default [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) to
5079
+ attach to this language.
5248
5080
  */
5249
- contentSeparator: Tag;
5081
+ languageData?: {
5082
+ [name: string]: any;
5083
+ };
5250
5084
  /**
5251
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a list.
5085
+ Extra tokens to use in this parser. When the tokenizer returns a
5086
+ token name that exists as a property in this object, the
5087
+ corresponding tag will be assigned to the token.
5252
5088
  */
5253
- list: Tag;
5089
+ tokenTable?: {
5090
+ [name: string]: Tag;
5091
+ };
5092
+ }
5093
+ /**
5094
+ A [language](https://codemirror.net/6/docs/ref/#language.Language) class based on a streaming
5095
+ parser.
5096
+ */
5097
+ declare class StreamLanguage<State> extends Language {
5098
+ private constructor();
5099
+ static define<State>(spec: StreamParser<State>): StreamLanguage<State>;
5100
+ private getIndent;
5101
+ get allowsNesting(): boolean;
5102
+ }
5103
+
5104
+ /**
5105
+ Extension to enable bracket-closing behavior. When a closeable
5106
+ bracket is typed, its closing bracket is immediately inserted
5107
+ after the cursor. When closing a bracket directly in front of a
5108
+ closing bracket inserted by the extension, the cursor moves over
5109
+ that bracket.
5110
+ */
5111
+ declare function closeBrackets(): Extension;
5112
+ /**
5113
+ Close-brackets related key bindings. Binds Backspace to
5114
+ [`deleteBracketPair`](https://codemirror.net/6/docs/ref/#closebrackets.deleteBracketPair).
5115
+ */
5116
+ declare const closeBracketsKeymap: readonly KeyBinding[];
5117
+
5118
+ /**
5119
+ Move the selection one group or camel-case subword forward.
5120
+ */
5121
+ declare const cursorSubwordForward: Command;
5122
+ /**
5123
+ Move the selection one group or camel-case subword backward.
5124
+ */
5125
+ declare const cursorSubwordBackward: Command;
5126
+ /**
5127
+ Move the selection to the bracket matching the one it is currently
5128
+ on, if any.
5129
+ */
5130
+ declare const cursorMatchingBracket: StateCommand;
5131
+ /**
5132
+ Extend the selection to the bracket matching the one the selection
5133
+ head is currently on, if any.
5134
+ */
5135
+ declare const selectMatchingBracket: StateCommand;
5136
+ /**
5137
+ Move the selection head one group or camel-case subword forward.
5138
+ */
5139
+ declare const selectSubwordForward: Command;
5140
+ /**
5141
+ Move the selection head one group or subword backward.
5142
+ */
5143
+ declare const selectSubwordBackward: Command;
5144
+ /**
5145
+ Replace the selection with a newline and indent the newly created
5146
+ line(s). If the current line consists only of whitespace, this
5147
+ will also delete that whitespace. When the cursor is between
5148
+ matching brackets, an additional newline will be inserted after
5149
+ the cursor.
5150
+ */
5151
+ declare const insertNewlineAndIndent: StateCommand;
5152
+ /**
5153
+ Add a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation to all selected
5154
+ lines.
5155
+ */
5156
+ declare const indentMore: StateCommand;
5157
+ /**
5158
+ Remove a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation from all
5159
+ selected lines.
5160
+ */
5161
+ declare const indentLess: StateCommand;
5162
+ /**
5163
+ An array of key bindings closely sticking to platform-standard or
5164
+ widely used bindings. (This includes the bindings from
5165
+ [`emacsStyleKeymap`](https://codemirror.net/6/docs/ref/#commands.emacsStyleKeymap), with their `key`
5166
+ property changed to `mac`.)
5167
+
5168
+ - ArrowLeft: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift)
5169
+ - ArrowRight: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift)
5170
+ - Ctrl-ArrowLeft (Alt-ArrowLeft on macOS): [`cursorGroupLeft`](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) ([`selectGroupLeft`](https://codemirror.net/6/docs/ref/#commands.selectGroupLeft) with Shift)
5171
+ - Ctrl-ArrowRight (Alt-ArrowRight on macOS): [`cursorGroupRight`](https://codemirror.net/6/docs/ref/#commands.cursorGroupRight) ([`selectGroupRight`](https://codemirror.net/6/docs/ref/#commands.selectGroupRight) with Shift)
5172
+ - Cmd-ArrowLeft (on macOS): [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift)
5173
+ - Cmd-ArrowRight (on macOS): [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift)
5174
+ - ArrowUp: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift)
5175
+ - ArrowDown: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift)
5176
+ - Cmd-ArrowUp (on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)
5177
+ - Cmd-ArrowDown (on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)
5178
+ - Ctrl-ArrowUp (on macOS): [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)
5179
+ - Ctrl-ArrowDown (on macOS): [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)
5180
+ - PageUp: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)
5181
+ - PageDown: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)
5182
+ - Home: [`cursorLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryBackward) ([`selectLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryBackward) with Shift)
5183
+ - End: [`cursorLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryForward) ([`selectLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryForward) with Shift)
5184
+ - Ctrl-Home (Cmd-Home on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)
5185
+ - Ctrl-End (Cmd-Home on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)
5186
+ - Enter: [`insertNewlineAndIndent`](https://codemirror.net/6/docs/ref/#commands.insertNewlineAndIndent)
5187
+ - Ctrl-a (Cmd-a on macOS): [`selectAll`](https://codemirror.net/6/docs/ref/#commands.selectAll)
5188
+ - Backspace: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward)
5189
+ - Delete: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward)
5190
+ - Ctrl-Backspace (Alt-Backspace on macOS): [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward)
5191
+ - Ctrl-Delete (Alt-Delete on macOS): [`deleteGroupForward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupForward)
5192
+ - Cmd-Backspace (macOS): [`deleteToLineStart`](https://codemirror.net/6/docs/ref/#commands.deleteToLineStart).
5193
+ - Cmd-Delete (macOS): [`deleteToLineEnd`](https://codemirror.net/6/docs/ref/#commands.deleteToLineEnd).
5194
+ */
5195
+ declare const standardKeymap: readonly KeyBinding[];
5196
+
5197
+ /**
5198
+ Comment or uncomment the current selection. Will use line comments
5199
+ if available, otherwise falling back to block comments.
5200
+ */
5201
+ declare const toggleComment: StateCommand;
5202
+
5203
+ /**
5204
+ Default fold-related key bindings.
5205
+
5206
+ - Ctrl-Shift-[ (Cmd-Alt-[ on macOS): [`foldCode`](https://codemirror.net/6/docs/ref/#fold.foldCode).
5207
+ - Ctrl-Shift-] (Cmd-Alt-] on macOS): [`unfoldCode`](https://codemirror.net/6/docs/ref/#fold.unfoldCode).
5208
+ - Ctrl-Alt-[: [`foldAll`](https://codemirror.net/6/docs/ref/#fold.foldAll).
5209
+ - Ctrl-Alt-]: [`unfoldAll`](https://codemirror.net/6/docs/ref/#fold.unfoldAll).
5210
+ */
5211
+ declare const foldKeymap: readonly KeyBinding[];
5212
+ interface FoldConfig {
5254
5213
  /**
5255
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a quote.
5214
+ A function that creates the DOM element used to indicate the
5215
+ position of folded code. The `onclick` argument is the default
5216
+ click event handler, which toggles folding on the line that
5217
+ holds the element, and should probably be added as an event
5218
+ handler to the returned element.
5219
+
5220
+ When this option isn't given, the `placeholderText` option will
5221
+ be used to create the placeholder element.
5256
5222
  */
5257
- quote: Tag;
5223
+ placeholderDOM?: ((view: EditorView, onclick: (event: Event) => void) => HTMLElement) | null;
5258
5224
  /**
5259
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is emphasized.
5225
+ Text to use as placeholder for folded text. Defaults to `"…"`.
5226
+ Will be styled with the `"cm-foldPlaceholder"` class.
5260
5227
  */
5261
- emphasis: Tag;
5228
+ placeholderText?: string;
5229
+ }
5230
+ /**
5231
+ Create an extension that configures code folding.
5232
+ */
5233
+ declare function codeFolding(config?: FoldConfig): Extension;
5234
+ declare type Handlers$1 = {
5235
+ [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
5236
+ };
5237
+ interface FoldGutterConfig {
5262
5238
  /**
5263
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is styled strong.
5239
+ A function that creates the DOM element used to indicate a
5240
+ given line is folded or can be folded.
5241
+ When not given, the `openText`/`closeText` option will be used instead.
5264
5242
  */
5265
- strong: Tag;
5243
+ markerDOM?: ((open: boolean) => HTMLElement) | null;
5266
5244
  /**
5267
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is part of a link.
5245
+ Text used to indicate that a given line can be folded.
5246
+ Defaults to `"⌄"`.
5268
5247
  */
5269
- link: Tag;
5248
+ openText?: string;
5270
5249
  /**
5271
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is styled as code or
5272
- monospace.
5250
+ Text used to indicate that a given line is folded.
5251
+ Defaults to `"›"`.
5273
5252
  */
5274
- monospace: Tag;
5253
+ closedText?: string;
5275
5254
  /**
5276
- [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that has a strike-through
5277
- style.
5255
+ Supply event handlers for DOM events on this gutter.
5278
5256
  */
5279
- strikethrough: Tag;
5257
+ domEventHandlers?: Handlers$1;
5258
+ }
5259
+ /**
5260
+ Create an extension that registers a fold gutter, which shows a
5261
+ fold status indicator before foldable lines (which can be clicked
5262
+ to fold or unfold the line).
5263
+ */
5264
+ declare function foldGutter(config?: FoldGutterConfig): Extension;
5265
+
5266
+ /**
5267
+ A gutter marker represents a bit of information attached to a line
5268
+ in a specific gutter. Your own custom markers have to extend this
5269
+ class.
5270
+ */
5271
+ declare abstract class GutterMarker extends RangeValue {
5280
5272
  /**
5281
- Inserted text in a change-tracking format.
5273
+ Compare this marker to another marker of the same type.
5282
5274
  */
5283
- inserted: Tag;
5275
+ eq(other: GutterMarker): boolean;
5284
5276
  /**
5285
- Deleted text.
5277
+ Render the DOM node for this marker, if any.
5286
5278
  */
5287
- deleted: Tag;
5279
+ toDOM?(_view: EditorView): Node;
5288
5280
  /**
5289
- Changed text.
5281
+ This property can be used to add CSS classes to the gutter
5282
+ element that contains this marker.
5290
5283
  */
5291
- changed: Tag;
5284
+ elementClass: string;
5292
5285
  /**
5293
- An invalid or unsyntactic element.
5286
+ Called if the marker has a `toDOM` method and its representation
5287
+ was removed from a gutter.
5294
5288
  */
5295
- invalid: Tag;
5289
+ destroy(dom: Node): void;
5290
+ }
5291
+ declare type Handlers = {
5292
+ [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
5293
+ };
5294
+ interface GutterConfig {
5296
5295
  /**
5297
- Metadata or meta-instruction.
5296
+ An extra CSS class to be added to the wrapper (`cm-gutter`)
5297
+ element.
5298
5298
  */
5299
- meta: Tag;
5299
+ class?: string;
5300
5300
  /**
5301
- [Metadata](https://codemirror.net/6/docs/ref/#highlight.tags.meta) that applies to the entire
5302
- document.
5301
+ Controls whether empty gutter elements should be rendered.
5302
+ Defaults to false.
5303
5303
  */
5304
- documentMeta: Tag;
5304
+ renderEmptyElements?: boolean;
5305
5305
  /**
5306
- [Metadata](https://codemirror.net/6/docs/ref/#highlight.tags.meta) that annotates or adds
5307
- attributes to a given syntactic element.
5306
+ Retrieve a set of markers to use in this gutter.
5308
5307
  */
5309
- annotation: Tag;
5308
+ markers?: (view: EditorView) => (RangeSet<GutterMarker> | readonly RangeSet<GutterMarker>[]);
5310
5309
  /**
5311
- Processing instruction or preprocessor directive. Subtag of
5312
- [meta](https://codemirror.net/6/docs/ref/#highlight.tags.meta).
5310
+ Can be used to optionally add a single marker to every line.
5313
5311
  */
5314
- processingInstruction: Tag;
5312
+ lineMarker?: (view: EditorView, line: BlockInfo, otherMarkers: readonly GutterMarker[]) => GutterMarker | null;
5315
5313
  /**
5316
- [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates that a
5317
- given element is being defined. Expected to be used with the
5318
- various [name](https://codemirror.net/6/docs/ref/#highlight.tags.name) tags.
5314
+ If line markers depend on additional state, and should be
5315
+ updated when that changes, pass a predicate here that checks
5316
+ whether a given view update might change the line markers.
5319
5317
  */
5320
- definition: (tag: Tag) => Tag;
5318
+ lineMarkerChange?: null | ((update: ViewUpdate) => boolean);
5321
5319
  /**
5322
- [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates that
5323
- something is constant. Mostly expected to be used with
5324
- [variable names](https://codemirror.net/6/docs/ref/#highlight.tags.variableName).
5320
+ Add a hidden spacer element that gives the gutter its base
5321
+ width.
5325
5322
  */
5326
- constant: (tag: Tag) => Tag;
5323
+ initialSpacer?: null | ((view: EditorView) => GutterMarker);
5327
5324
  /**
5328
- [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) used to indicate that
5329
- a [variable](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) or [property
5330
- name](https://codemirror.net/6/docs/ref/#highlight.tags.propertyName) is being called or defined
5331
- as a function.
5325
+ Update the spacer element when the view is updated.
5332
5326
  */
5333
- function: (tag: Tag) => Tag;
5327
+ updateSpacer?: null | ((spacer: GutterMarker, update: ViewUpdate) => GutterMarker);
5334
5328
  /**
5335
- [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that can be applied to
5336
- [names](https://codemirror.net/6/docs/ref/#highlight.tags.name) to indicate that they belong to
5337
- the language's standard environment.
5329
+ Supply event handlers for DOM events on this gutter.
5338
5330
  */
5339
- standard: (tag: Tag) => Tag;
5331
+ domEventHandlers?: Handlers;
5332
+ }
5333
+ /**
5334
+ Define an editor gutter. The order in which the gutters appear is
5335
+ determined by their extension priority.
5336
+ */
5337
+ declare function gutter(config: GutterConfig): Extension;
5338
+ /**
5339
+ The gutter-drawing plugin is automatically enabled when you add a
5340
+ gutter, but you can use this function to explicitly configure it.
5341
+
5342
+ Unless `fixed` is explicitly set to `false`, the gutters are
5343
+ fixed, meaning they don't scroll along with the content
5344
+ horizontally (except on Internet Explorer, which doesn't support
5345
+ CSS [`position:
5346
+ sticky`](https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky)).
5347
+ */
5348
+ declare function gutters(config?: {
5349
+ fixed?: boolean;
5350
+ }): Extension;
5351
+ interface LineNumberConfig {
5340
5352
  /**
5341
- [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates a given
5342
- [names](https://codemirror.net/6/docs/ref/#highlight.tags.name) is local to some scope.
5353
+ How to display line numbers. Defaults to simply converting them
5354
+ to string.
5343
5355
  */
5344
- local: (tag: Tag) => Tag;
5356
+ formatNumber?: (lineNo: number, state: EditorState) => string;
5345
5357
  /**
5346
- A generic variant [modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that
5347
- can be used to tag language-specific alternative variants of
5348
- some common tag. It is recommended for themes to define special
5349
- forms of at least the [string](https://codemirror.net/6/docs/ref/#highlight.tags.string) and
5350
- [variable name](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) tags, since those
5351
- come up a lot.
5358
+ Supply event handlers for DOM events on this gutter.
5352
5359
  */
5353
- special: (tag: Tag) => Tag;
5354
- };
5360
+ domEventHandlers?: Handlers;
5361
+ }
5362
+ /**
5363
+ Facet used to provide markers to the line number gutter.
5364
+ */
5365
+ declare const lineNumberMarkers: Facet<RangeSet<GutterMarker>, readonly RangeSet<GutterMarker>[]>;
5366
+ /**
5367
+ Create a line number gutter extension.
5368
+ */
5369
+ declare function lineNumbers(config?: LineNumberConfig): Extension;
5355
5370
 
5356
5371
  interface HistoryConfig {
5357
5372
  /**
@@ -5729,6 +5744,12 @@ interface TooltipView {
5729
5744
  y: number;
5730
5745
  };
5731
5746
  /**
5747
+ By default, tooltips are moved when they overlap with other
5748
+ tooltips. Set this to `true` to disable that behavior for this
5749
+ tooltip.
5750
+ */
5751
+ overlap?: boolean;
5752
+ /**
5732
5753
  Called after the tooltip is added to the DOM for the first time.
5733
5754
  */
5734
5755
  mount?(view: EditorView): void;