@vscode/markdown-editor 0.0.2-30 → 0.0.2-31

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/dist/index.d.ts CHANGED
@@ -1243,13 +1243,25 @@ export declare class EditorView extends Disposable {
1243
1243
  showReadonlyEditingAttempt(): void;
1244
1244
  focus(): void;
1245
1245
  /**
1246
- * Focuses the editor when it opens, but only if doing so will not steal
1247
- * focus from an explicit user target: the window must already be focused and
1248
- * no other element may have claimed focus yet. Returns whether focus was
1249
- * taken. Intended for the single editable editor on open; a no-op for a
1250
- * background window or when the user has already focused something else.
1246
+ * One-shot guarded focus attempt: focuses the editor only if doing so will
1247
+ * not steal focus from an explicit user target the window must already be
1248
+ * focused and no other element may have claimed focus yet. Returns whether
1249
+ * focus was taken. A no-op for a background window or when the user has
1250
+ * already focused something else. {@link autoFocusOnOpen} builds the
1251
+ * open-time behavior on top of this primitive.
1251
1252
  */
1252
1253
  tryAutoFocus(): boolean;
1254
+ /**
1255
+ * Focuses the editor when it opens without ever stealing focus from an
1256
+ * explicit user target. Tries once immediately ({@link tryAutoFocus}); if the
1257
+ * window is not focused yet — a common open-time race where the editor is
1258
+ * mounted before the host routes focus to its window — the guarded attempt is
1259
+ * deferred to the next time the window gains focus and re-evaluated then. The
1260
+ * deferral is one-shot, so a later, unrelated window refocus never grabs
1261
+ * focus, and the re-check still respects any target the user has claimed in
1262
+ * the meantime.
1263
+ */
1264
+ autoFocusOnOpen(): void;
1253
1265
  /**
1254
1266
  * Own point→offset resolution. When `true` (the default),
1255
1267
  * {@link resolveOffsetFromPoint} ignores the platform DOM hit-test