devtools-protocol 0.0.1696802 → 0.0.1697629

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.
@@ -9044,6 +9044,55 @@
9044
9044
  "type": "boolean"
9045
9045
  }
9046
9046
  ]
9047
+ },
9048
+ {
9049
+ "name": "setTextMarker",
9050
+ "description": "Sets a spelling or grammar error marker on the given range of text.\nSee https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md\nNote: exactly one between nodeId, backendNodeId and objectId should be passed\nto identify the node.",
9051
+ "experimental": true,
9052
+ "parameters": [
9053
+ {
9054
+ "name": "nodeId",
9055
+ "description": "Identifier of the node.",
9056
+ "optional": true,
9057
+ "$ref": "NodeId"
9058
+ },
9059
+ {
9060
+ "name": "backendNodeId",
9061
+ "description": "Identifier of the backend node.",
9062
+ "optional": true,
9063
+ "$ref": "BackendNodeId"
9064
+ },
9065
+ {
9066
+ "name": "objectId",
9067
+ "description": "JavaScript object id of the node wrapper.",
9068
+ "optional": true,
9069
+ "$ref": "Runtime.RemoteObjectId"
9070
+ },
9071
+ {
9072
+ "name": "type",
9073
+ "description": "The type of marker to set on the given range of text.",
9074
+ "type": "string",
9075
+ "enum": [
9076
+ "spelling",
9077
+ "grammar"
9078
+ ]
9079
+ },
9080
+ {
9081
+ "name": "start",
9082
+ "description": "Start offset into the element's rendered text in UTF-16 code units.\nFor a text control, an offset into the control's value.\nOffsets count text in DOM order and do not enter shadow trees.\nTo mark text inside a shadow tree, pass the element inside the shadow tree.",
9083
+ "type": "integer"
9084
+ },
9085
+ {
9086
+ "name": "end",
9087
+ "description": "End offset (exclusive) in the same units and space as start.",
9088
+ "type": "integer"
9089
+ }
9090
+ ]
9091
+ },
9092
+ {
9093
+ "name": "clearTextMarkers",
9094
+ "description": "Clears the spelling and grammar error text markers overlapping the ranges\nset by setTextMarker in this session. These markers are also removed when\nthe DOM domain is disabled or the session ends.",
9095
+ "experimental": true
9047
9096
  }
9048
9097
  ],
9049
9098
  "events": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devtools-protocol",
3
- "version": "0.0.1696802",
3
+ "version": "0.0.1697629",
4
4
  "description": "The Chrome DevTools Protocol JSON",
5
5
  "repository": "https://github.com/ChromeDevTools/devtools-protocol",
6
6
  "author": "The Chromium Authors",
@@ -845,6 +845,37 @@ domain DOM
845
845
  # If true, opens and holds interest. If false, releases forced interest.
846
846
  boolean enable
847
847
 
848
+ # Sets a spelling or grammar error marker on the given range of text.
849
+ # See https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md
850
+ # Note: exactly one between nodeId, backendNodeId and objectId should be passed
851
+ # to identify the node.
852
+ experimental command setTextMarker
853
+ parameters
854
+ # Identifier of the node.
855
+ optional NodeId nodeId
856
+ # Identifier of the backend node.
857
+ optional BackendNodeId backendNodeId
858
+ # JavaScript object id of the node wrapper.
859
+ optional Runtime.RemoteObjectId objectId
860
+ # The type of marker to set on the given range of text.
861
+ enum type
862
+ # A spelling error marker, rendered as ::spelling-error
863
+ spelling
864
+ # A grammar error marker, rendered as ::grammar-error
865
+ grammar
866
+ # Start offset into the element's rendered text in UTF-16 code units.
867
+ # For a text control, an offset into the control's value.
868
+ # Offsets count text in DOM order and do not enter shadow trees.
869
+ # To mark text inside a shadow tree, pass the element inside the shadow tree.
870
+ integer start
871
+ # End offset (exclusive) in the same units and space as start.
872
+ integer end
873
+
874
+ # Clears the spelling and grammar error text markers overlapping the ranges
875
+ # set by setTextMarker in this session. These markers are also removed when
876
+ # the DOM domain is disabled or the session ends.
877
+ experimental command clearTextMarkers
878
+
848
879
  # Fired when `Element`'s attribute is modified.
849
880
  event attributeModified
850
881
  parameters
@@ -3062,6 +3062,27 @@ export namespace ProtocolMapping {
3062
3062
  paramsType: [Protocol.DOM.ForceShowInterestRequest];
3063
3063
  returnType: void;
3064
3064
  };
3065
+ /**
3066
+ * Sets a spelling or grammar error marker on the given range of text.
3067
+ * See https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md
3068
+ * Note: exactly one between nodeId, backendNodeId and objectId should be passed
3069
+ * to identify the node.
3070
+ * @experimental
3071
+ */
3072
+ 'DOM.setTextMarker': {
3073
+ paramsType: [Protocol.DOM.SetTextMarkerRequest];
3074
+ returnType: void;
3075
+ };
3076
+ /**
3077
+ * Clears the spelling and grammar error text markers overlapping the ranges
3078
+ * set by setTextMarker in this session. These markers are also removed when
3079
+ * the DOM domain is disabled or the session ends.
3080
+ * @experimental
3081
+ */
3082
+ 'DOM.clearTextMarkers': {
3083
+ paramsType: [];
3084
+ returnType: void;
3085
+ };
3065
3086
  /**
3066
3087
  * Returns event listeners of the given object.
3067
3088
  */
@@ -1892,6 +1892,23 @@ export namespace ProtocolProxyApi {
1892
1892
  */
1893
1893
  forceShowInterest(params: Protocol.DOM.ForceShowInterestRequest): Promise<void>;
1894
1894
 
1895
+ /**
1896
+ * Sets a spelling or grammar error marker on the given range of text.
1897
+ * See https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md
1898
+ * Note: exactly one between nodeId, backendNodeId and objectId should be passed
1899
+ * to identify the node.
1900
+ * @experimental
1901
+ */
1902
+ setTextMarker(params: Protocol.DOM.SetTextMarkerRequest): Promise<void>;
1903
+
1904
+ /**
1905
+ * Clears the spelling and grammar error text markers overlapping the ranges
1906
+ * set by setTextMarker in this session. These markers are also removed when
1907
+ * the DOM domain is disabled or the session ends.
1908
+ * @experimental
1909
+ */
1910
+ clearTextMarkers(): Promise<void>;
1911
+
1895
1912
  /**
1896
1913
  * Fired when `Element`'s attribute is modified.
1897
1914
  */
@@ -1982,6 +1982,23 @@ export namespace ProtocolTestsProxyApi {
1982
1982
  */
1983
1983
  forceShowInterest(params: Protocol.DOM.ForceShowInterestRequest): Promise<{id: number, result: void, sessionId: string}>;
1984
1984
 
1985
+ /**
1986
+ * Sets a spelling or grammar error marker on the given range of text.
1987
+ * See https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md
1988
+ * Note: exactly one between nodeId, backendNodeId and objectId should be passed
1989
+ * to identify the node.
1990
+ * @experimental
1991
+ */
1992
+ setTextMarker(params: Protocol.DOM.SetTextMarkerRequest): Promise<{id: number, result: void, sessionId: string}>;
1993
+
1994
+ /**
1995
+ * Clears the spelling and grammar error text markers overlapping the ranges
1996
+ * set by setTextMarker in this session. These markers are also removed when
1997
+ * the DOM domain is disabled or the session ends.
1998
+ * @experimental
1999
+ */
2000
+ clearTextMarkers(): Promise<{id: number, result: void, sessionId: string}>;
2001
+
1985
2002
  /**
1986
2003
  * Fired when `Element`'s attribute is modified.
1987
2004
  */
@@ -8218,6 +8218,41 @@ export namespace Protocol {
8218
8218
  enable: boolean;
8219
8219
  }
8220
8220
 
8221
+ export const enum SetTextMarkerRequestType {
8222
+ Spelling = 'spelling',
8223
+ Grammar = 'grammar',
8224
+ }
8225
+
8226
+ export interface SetTextMarkerRequest {
8227
+ /**
8228
+ * Identifier of the node.
8229
+ */
8230
+ nodeId?: NodeId;
8231
+ /**
8232
+ * Identifier of the backend node.
8233
+ */
8234
+ backendNodeId?: BackendNodeId;
8235
+ /**
8236
+ * JavaScript object id of the node wrapper.
8237
+ */
8238
+ objectId?: Runtime.RemoteObjectId;
8239
+ /**
8240
+ * The type of marker to set on the given range of text.
8241
+ */
8242
+ type: ('spelling' | 'grammar');
8243
+ /**
8244
+ * Start offset into the element's rendered text in UTF-16 code units.
8245
+ * For a text control, an offset into the control's value.
8246
+ * Offsets count text in DOM order and do not enter shadow trees.
8247
+ * To mark text inside a shadow tree, pass the element inside the shadow tree.
8248
+ */
8249
+ start: integer;
8250
+ /**
8251
+ * End offset (exclusive) in the same units and space as start.
8252
+ */
8253
+ end: integer;
8254
+ }
8255
+
8221
8256
  /**
8222
8257
  * Fired when `Element`'s attribute is modified.
8223
8258
  */