Skip to content

Commit

Permalink
npm update (markdown seems to have a latest version)
Browse files Browse the repository at this point in the history
  • Loading branch information
pankgeorg committed Dec 22, 2021
1 parent 0f96685 commit 74b543d
Show file tree
Hide file tree
Showing 3 changed files with 1,555 additions and 1,308 deletions.
76 changes: 64 additions & 12 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1383,8 +1383,8 @@ declare class Tree {
cursor(pos?: number, side?: -1 | 0 | 1): TreeCursor;
fullCursor(): TreeCursor;
get topNode(): SyntaxNode;
resolve(pos: number, side?: -1 | 0 | 1): SyntaxNode;
resolveInner(pos: number, side?: -1 | 0 | 1): SyntaxNode;
resolve(pos: number, side?: -1 | 0 | 1): any;
resolveInner(pos: number, side?: -1 | 0 | 1): any;
iterate(spec: {
enter(type: NodeType, from: number, to: number, get: () => SyntaxNode): false | void;
leave?(type: NodeType, from: number, to: number, get: () => SyntaxNode): void;
Expand Down Expand Up @@ -1647,6 +1647,11 @@ interface SpanIterator<T extends RangeValue> {
`active.length + 1` to signal this.
*/
point(from: number, to: number, value: T, active: readonly T[], openStart: number): void;
/**
When provided, this will be called for each point processed,
causing the ones for which it returns false to be ignored.
*/
filterPoint?(from: number, to: number, value: T, index: number): boolean;
}
/**
A range cursor is an object that moves to the next range every
Expand Down Expand Up @@ -2063,6 +2068,7 @@ interface Rect {
readonly top: number;
readonly bottom: number;
}
declare type ScrollStrategy = "nearest" | "start" | "end" | "center";

/**
Command functions are used in key bindings and other types of user
Expand Down Expand Up @@ -2125,11 +2131,13 @@ declare class PluginField<T> {
**Note**: For reasons of data flow (plugins are only updated
after the viewport is computed), decorations produced by plugins
are _not_ taken into account when predicting the vertical layout
structure of the editor. Thus, things like large widgets or big
replacements (i.e. code folding) should be provided through the
state-level [`decorations` facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations),
not this plugin field. Specifically, replacing decorations that
cross line boundaries will break if provided through a plugin.
structure of the editor. They **must not** introduce block
widgets (that will raise an error) or replacing decorations that
cover line breaks (these will be ignored if they occur). Such
decorations, or others that cause a large amount of vertical
size shift compared to the undecorated content, should be
provided through the state-level [`decorations`
facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations) instead.
*/
static decorations: PluginField<DecorationSet>;
/**
Expand Down Expand Up @@ -2255,12 +2263,13 @@ declare class ViewUpdate {
*/
get viewportChanged(): boolean;
/**
Indicates whether the line height in the editor changed in this update.
Indicates whether the height of an element in the editor changed
in this update.
*/
get heightChanged(): boolean;
/**
Returns true when the document changed or the size of the editor
or the lines or characters within it has changed.
Returns true when the document was modified or the size of the
editor, or elements within the editor, changed.
*/
get geometryChanged(): boolean;
/**
Expand Down Expand Up @@ -2705,6 +2714,11 @@ declare class EditorView {
Find the DOM parent node and offset (child offset if `node` is
an element, character offset when it is a text node) at the
given document position.
Note that for positions that aren't currently in
`visibleRanges`, the resulting DOM position isn't necessarily
meaningful (it may just point before or after a placeholder
element).
*/
domAtPos(pos: number): {
node: Node;
Expand All @@ -2717,8 +2731,11 @@ declare class EditorView {
*/
posAtDOM(node: Node, offset?: number): number;
/**
Get the document position at the given screen coordinates.
Returns null if no valid position could be found.
Get the document position at the given screen coordinates. For
positions not covered by the visible viewport's DOM structure,
this will return null, unless `false` is passed as second
argument, in which case it'll return an estimated position that
would be near the coordinates if it were rendered.
*/
posAtCoords(coords: {
x: number;
Expand Down Expand Up @@ -2787,14 +2804,49 @@ declare class EditorView {
/**
Effect that can be [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a
transaction to make it scroll the given range into view.
*Deprecated*. Use [`scrollIntoView`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView) instead.
*/
static scrollTo: StateEffectType<SelectionRange>;
/**
Effect that makes the editor scroll the given range to the
center of the visible view.
*Deprecated*. Use [`scrollIntoView`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView) instead.
*/
static centerOn: StateEffectType<SelectionRange>;
/**
Returns an effect that can be
[added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
cause it to scroll the given position or range into view.
*/
static scrollIntoView(pos: number | SelectionRange, options?: {
/**
By default (`"nearest"`) the position will be vertically
scrolled only the minimal amount required to move the given
position into view. You can set this to `"start"` to move it
to the top of the view, `"end"` to move it to the bottom, or
`"center"` to move it to the center.
*/
y?: ScrollStrategy;
/**
Effect similar to
[`y`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView^options.y), but for the
horizontal scroll position.
*/
x?: ScrollStrategy;
/**
Extra vertical distance to add when moving something into
view. Not used with the `"center"` strategy. Defaults to 5.
*/
yMargin?: number;
/**
Extra horizontal distance to add. Not used with the `"center"`
strategy. Defaults to 5.
*/
xMargin?: number;
}): StateEffect<unknown>;
/**
Facet to add a [style
module](https://github.com/marijnh/style-mod#documentation) to
an editor view. The view will ensure that the module is
Expand Down
Loading

0 comments on commit 74b543d

Please sign in to comment.