@pulsar-edit/types 1.128.1
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/.github/workflows/publish.yml +33 -0
- package/LICENSE.md +8 -0
- package/README.md +187 -0
- package/atom-i18n/config.d.ts +9 -0
- package/atom-i18n/index.d.ts +4 -0
- package/autocomplete-plus/config.d.ts +140 -0
- package/autocomplete-plus/index.d.ts +200 -0
- package/dependencies/event-kit/index.d.ts +143 -0
- package/dependencies/first-mate/index.d.ts +1 -0
- package/dependencies/first-mate/src/first-mate.d.ts +1 -0
- package/dependencies/first-mate/src/grammar.d.ts +119 -0
- package/dependencies/pathwatcher/index.d.ts +1 -0
- package/dependencies/pathwatcher/src/directory.d.ts +98 -0
- package/dependencies/pathwatcher/src/file.d.ts +115 -0
- package/dependencies/pathwatcher/src/main.d.ts +2 -0
- package/dependencies/service-hub/index.d.ts +3 -0
- package/dependencies/service-hub/src/consumer.d.ts +8 -0
- package/dependencies/service-hub/src/provider.d.ts +14 -0
- package/dependencies/service-hub/src/service-hub.d.ts +46 -0
- package/dependencies/service-hub/src/util.d.ts +1 -0
- package/dependencies/text-buffer/index.d.ts +1 -0
- package/dependencies/text-buffer/src/display-marker-layer.d.ts +182 -0
- package/dependencies/text-buffer/src/display-marker.d.ts +232 -0
- package/dependencies/text-buffer/src/helpers.d.ts +11 -0
- package/dependencies/text-buffer/src/marker-layer.d.ts +117 -0
- package/dependencies/text-buffer/src/marker.d.ts +207 -0
- package/dependencies/text-buffer/src/point.d.ts +102 -0
- package/dependencies/text-buffer/src/range.d.ts +141 -0
- package/dependencies/text-buffer/src/text-buffer.d.ts +759 -0
- package/index.d.ts +72 -0
- package/linter/config.d.ts +26 -0
- package/linter/index.d.ts +108 -0
- package/package.json +61 -0
- package/src/atom-environment.d.ts +361 -0
- package/src/branding.d.ts +19 -0
- package/src/buffered-node-process.d.ts +10 -0
- package/src/buffered-process.d.ts +88 -0
- package/src/clipboard.d.ts +14 -0
- package/src/color.d.ts +11 -0
- package/src/command-registry.d.ts +118 -0
- package/src/config-schema.d.ts +271 -0
- package/src/config.d.ts +168 -0
- package/src/context-menu-manager.d.ts +65 -0
- package/src/cursor.d.ts +252 -0
- package/src/decoration.d.ts +156 -0
- package/src/deserializer-manager.d.ts +15 -0
- package/src/dock.d.ts +121 -0
- package/src/get-window-load-settings.d.ts +26 -0
- package/src/git-repository.d.ts +174 -0
- package/src/grammar-registry.d.ts +241 -0
- package/src/gutter.d.ts +118 -0
- package/src/history-manager.d.ts +28 -0
- package/src/keymap-extensions.d.ts +190 -0
- package/src/language-mode.d.ts +314 -0
- package/src/layer-decoration.d.ts +31 -0
- package/src/menu-manager.d.ts +24 -0
- package/src/notification-manager.d.ts +37 -0
- package/src/notification.d.ts +79 -0
- package/src/other-types.d.ts +283 -0
- package/src/package-manager.d.ts +103 -0
- package/src/package.d.ts +33 -0
- package/src/pane.d.ts +604 -0
- package/src/panel.d.ts +38 -0
- package/src/path-watcher.d.ts +35 -0
- package/src/project.d.ts +110 -0
- package/src/scope-descriptor.d.ts +8 -0
- package/src/selection.d.ts +341 -0
- package/src/style-manager.d.ts +68 -0
- package/src/task.d.ts +38 -0
- package/src/text-editor-component.d.ts +15 -0
- package/src/text-editor-element.d.ts +48 -0
- package/src/text-editor-registry.d.ts +48 -0
- package/src/text-editor.d.ts +1416 -0
- package/src/theme-manager.d.ts +29 -0
- package/src/tooltip-manager.d.ts +42 -0
- package/src/tooltip.d.ts +63 -0
- package/src/ui.d.ts +101 -0
- package/src/view-registry.d.ts +34 -0
- package/src/wasm-tree-sitter-grammar.d.ts +305 -0
- package/src/wasm-tree-sitter-language-mode.d.ts +294 -0
- package/src/workspace-center.d.ts +117 -0
- package/src/workspace.d.ts +485 -0
- package/status-bar/config.d.ts +23 -0
- package/status-bar/index.d.ts +51 -0
- package/tool-bar/config.d.ts +20 -0
- package/tool-bar/index.d.ts +235 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Disposable } from "../../../index";
|
|
2
|
+
import {
|
|
3
|
+
DisplayMarker,
|
|
4
|
+
Marker,
|
|
5
|
+
PointCompatible,
|
|
6
|
+
RangeCompatible
|
|
7
|
+
} from "./text-buffer";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Experimental: A container for a related set of markers at the DisplayLayer
|
|
11
|
+
* level. Wraps an underlying MarkerLayer on the TextBuffer.
|
|
12
|
+
*
|
|
13
|
+
* This API is experimental and subject to change on any release.
|
|
14
|
+
*/
|
|
15
|
+
export interface DisplayMarkerLayer {
|
|
16
|
+
/** The identifier for the underlying MarkerLayer. */
|
|
17
|
+
readonly id: string;
|
|
18
|
+
|
|
19
|
+
// Lifecycle
|
|
20
|
+
/** Destroy this layer. */
|
|
21
|
+
destroy(): void;
|
|
22
|
+
|
|
23
|
+
/** Destroy all markers in this layer. */
|
|
24
|
+
clear(): void;
|
|
25
|
+
|
|
26
|
+
/** Determine whether this layer has been destroyed. */
|
|
27
|
+
isDestroyed(): boolean;
|
|
28
|
+
|
|
29
|
+
// Event Subscription
|
|
30
|
+
/** Subscribe to be notified synchronously when this layer is destroyed. */
|
|
31
|
+
onDidDestroy(callback: () => void): Disposable;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Subscribe to be notified asynchronously whenever markers are created,
|
|
35
|
+
* updated, or destroyed on this layer. Prefer this method for optimal
|
|
36
|
+
* performance when interacting with layers that could contain large numbers
|
|
37
|
+
* of markers.
|
|
38
|
+
*/
|
|
39
|
+
onDidUpdate(callback: () => void): Disposable;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Subscribe to be notified synchronously whenever markers are created on
|
|
43
|
+
* this layer. Avoid this method for optimal performance when interacting
|
|
44
|
+
* with layers that could contain large numbers of markers.
|
|
45
|
+
*/
|
|
46
|
+
onDidCreateMarker(callback: (marker: DisplayMarker | Marker) => void): Disposable;
|
|
47
|
+
|
|
48
|
+
// Marker creation
|
|
49
|
+
/** Create a marker with the given screen range. */
|
|
50
|
+
markScreenRange(
|
|
51
|
+
range: RangeCompatible,
|
|
52
|
+
options?: {
|
|
53
|
+
reversed?: boolean | undefined;
|
|
54
|
+
invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
|
|
55
|
+
exclusive?: boolean | undefined;
|
|
56
|
+
clipDirection?: "backward" | "forward" | "closest" | undefined;
|
|
57
|
+
},
|
|
58
|
+
): DisplayMarker;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Create a marker on this layer with its head at the given screen position
|
|
62
|
+
* and no tail.
|
|
63
|
+
*/
|
|
64
|
+
markScreenPosition(
|
|
65
|
+
screenPosition: PointCompatible,
|
|
66
|
+
options?: {
|
|
67
|
+
invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
|
|
68
|
+
exclusive?: boolean | undefined;
|
|
69
|
+
clipDirection?: "backward" | "forward" | "closest" | undefined;
|
|
70
|
+
},
|
|
71
|
+
): DisplayMarker;
|
|
72
|
+
|
|
73
|
+
/** Create a marker with the given buffer range. */
|
|
74
|
+
markBufferRange(
|
|
75
|
+
range: RangeCompatible,
|
|
76
|
+
options?: {
|
|
77
|
+
reversed?: boolean | undefined;
|
|
78
|
+
invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
|
|
79
|
+
exclusive?: boolean | undefined;
|
|
80
|
+
},
|
|
81
|
+
): DisplayMarker;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Create a marker on this layer with its head at the given buffer position
|
|
85
|
+
* and no tail.
|
|
86
|
+
*/
|
|
87
|
+
markBufferPosition(
|
|
88
|
+
bufferPosition: PointCompatible,
|
|
89
|
+
options?: {
|
|
90
|
+
invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
|
|
91
|
+
exclusive?: boolean | undefined;
|
|
92
|
+
},
|
|
93
|
+
): DisplayMarker;
|
|
94
|
+
|
|
95
|
+
// Querying
|
|
96
|
+
/** Get an existing marker by its id. */
|
|
97
|
+
getMarker(id: number): DisplayMarker;
|
|
98
|
+
|
|
99
|
+
/** Get all markers in the layer. */
|
|
100
|
+
getMarkers(): DisplayMarker[];
|
|
101
|
+
|
|
102
|
+
/** Get the number of markers in the marker layer. */
|
|
103
|
+
getMarkerCount(): number;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Find markers in the layer conforming to the given parameters.
|
|
107
|
+
*
|
|
108
|
+
* This method finds markers based on the given properties. Markers can be
|
|
109
|
+
* associated with custom properties that will be compared with basic
|
|
110
|
+
* equality. In addition, there are several special properties that will be
|
|
111
|
+
* compared with the range of the markers rather than their properties.
|
|
112
|
+
*/
|
|
113
|
+
findMarkers(properties: FindDisplayMarkerOptions): DisplayMarker[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface FindDisplayMarkerOptions {
|
|
117
|
+
/** Only include markers starting at this Point in buffer coordinates. */
|
|
118
|
+
startBufferPosition?: PointCompatible | undefined;
|
|
119
|
+
|
|
120
|
+
/** Only include markers ending at this Point in buffer coordinates. */
|
|
121
|
+
endBufferPosition?: PointCompatible | undefined;
|
|
122
|
+
|
|
123
|
+
/** Only include markers starting at this Point in screen coordinates. */
|
|
124
|
+
startScreenPosition?: PointCompatible | undefined;
|
|
125
|
+
|
|
126
|
+
/** Only include markers ending at this Point in screen coordinates. */
|
|
127
|
+
endScreenPosition?: PointCompatible | undefined;
|
|
128
|
+
|
|
129
|
+
/** Only include markers starting inside this Range in buffer coordinates. */
|
|
130
|
+
startsInBufferRange?: RangeCompatible | undefined;
|
|
131
|
+
|
|
132
|
+
/** Only include markers ending inside this Range in buffer coordinates. */
|
|
133
|
+
endsInBufferRange?: RangeCompatible | undefined;
|
|
134
|
+
|
|
135
|
+
/** Only include markers starting inside this Range in screen coordinates. */
|
|
136
|
+
startsInScreenRange?: RangeCompatible | undefined;
|
|
137
|
+
|
|
138
|
+
/** Only include markers ending inside this Range in screen coordinates. */
|
|
139
|
+
endsInScreenRange?: RangeCompatible | undefined;
|
|
140
|
+
|
|
141
|
+
/** Only include markers starting at this row in buffer coordinates. */
|
|
142
|
+
startBufferRow?: number | undefined;
|
|
143
|
+
|
|
144
|
+
/** Only include markers ending at this row in buffer coordinates. */
|
|
145
|
+
endBufferRow?: number | undefined;
|
|
146
|
+
|
|
147
|
+
/** Only include markers starting at this row in screen coordinates. */
|
|
148
|
+
startScreenRow?: number | undefined;
|
|
149
|
+
|
|
150
|
+
/** Only include markers ending at this row in screen coordinates. */
|
|
151
|
+
endScreenRow?: number | undefined;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Only include markers intersecting this Array of [startRow, endRow] in
|
|
155
|
+
* buffer coordinates.
|
|
156
|
+
*/
|
|
157
|
+
intersectsBufferRowRange?: [number, number] | undefined;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Only include markers intersecting this Array of [startRow, endRow] in
|
|
161
|
+
* screen coordinates.
|
|
162
|
+
*/
|
|
163
|
+
intersectsScreenRowRange?: [number, number] | undefined;
|
|
164
|
+
|
|
165
|
+
/** Only include markers containing this Range in buffer coordinates. */
|
|
166
|
+
containsBufferRange?: RangeCompatible | undefined;
|
|
167
|
+
|
|
168
|
+
/** Only include markers containing this Point in buffer coordinates. */
|
|
169
|
+
containsBufferPosition?: PointCompatible | undefined;
|
|
170
|
+
|
|
171
|
+
/** Only include markers contained in this Range in buffer coordinates. */
|
|
172
|
+
containedInBufferRange?: RangeCompatible | undefined;
|
|
173
|
+
|
|
174
|
+
/** Only include markers contained in this Range in screen coordinates. */
|
|
175
|
+
containedInScreenRange?: RangeCompatible | undefined;
|
|
176
|
+
|
|
177
|
+
/** Only include markers intersecting this Range in buffer coordinates. */
|
|
178
|
+
intersectsBufferRange?: RangeCompatible | undefined;
|
|
179
|
+
|
|
180
|
+
/** Only include markers intersecting this Range in screen coordinates. */
|
|
181
|
+
intersectsScreenRange?: RangeCompatible | undefined;
|
|
182
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { Disposable } from "../../../index";
|
|
2
|
+
import {
|
|
3
|
+
CopyMarkerOptions,
|
|
4
|
+
FindDisplayMarkerOptions,
|
|
5
|
+
Point,
|
|
6
|
+
PointCompatible,
|
|
7
|
+
Range,
|
|
8
|
+
RangeCompatible,
|
|
9
|
+
} from "./text-buffer";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents a buffer annotation that remains logically stationary even as the
|
|
13
|
+
* buffer changes. This is used to represent cursors, folds, snippet targets,
|
|
14
|
+
* misspelled words, and anything else that needs to track a logical location
|
|
15
|
+
* in the buffer over time.
|
|
16
|
+
*/
|
|
17
|
+
export interface DisplayMarker {
|
|
18
|
+
id: string;
|
|
19
|
+
|
|
20
|
+
// Construction and Destruction
|
|
21
|
+
/**
|
|
22
|
+
* Destroys the marker, causing it to emit the 'destroyed' event. Once
|
|
23
|
+
* destroyed, a marker cannot be restored by undo/redo operations.
|
|
24
|
+
*/
|
|
25
|
+
destroy(): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates and returns a new DisplayMarker with the same properties as this
|
|
29
|
+
* marker.
|
|
30
|
+
*/
|
|
31
|
+
copy(options?: CopyMarkerOptions): DisplayMarker;
|
|
32
|
+
|
|
33
|
+
// Event Subscription
|
|
34
|
+
/** Invoke the given callback when the state of the marker changes. */
|
|
35
|
+
onDidChange(callback: (event: DisplayMarkerChangedEvent) => void): Disposable;
|
|
36
|
+
|
|
37
|
+
/** Invoke the given callback when the marker is destroyed. */
|
|
38
|
+
onDidDestroy(callback: () => void): Disposable;
|
|
39
|
+
|
|
40
|
+
// TextEditorMarker Details
|
|
41
|
+
/**
|
|
42
|
+
* Returns a boolean indicating whether the marker is valid. Markers can be
|
|
43
|
+
* invalidated when a region surrounding them in the buffer is changed.
|
|
44
|
+
*/
|
|
45
|
+
isValid(): boolean;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns a boolean indicating whether the marker has been destroyed. A
|
|
49
|
+
* marker can be invalid without being destroyed, in which case undoing the
|
|
50
|
+
* invalidating operation would restore the marker.
|
|
51
|
+
*/
|
|
52
|
+
isDestroyed(): boolean;
|
|
53
|
+
|
|
54
|
+
/** Returns a boolean indicating whether the head precedes the tail. */
|
|
55
|
+
isReversed(): boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns a boolean indicating whether changes that occur exactly at the
|
|
59
|
+
* marker's head or tail cause it to move.
|
|
60
|
+
*/
|
|
61
|
+
isExclusive(): boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get the invalidation strategy for this marker.
|
|
65
|
+
*
|
|
66
|
+
* Valid values include: never, surround, overlap, inside, and touch.
|
|
67
|
+
*/
|
|
68
|
+
getInvalidationStrategy(): string;
|
|
69
|
+
|
|
70
|
+
/** Returns an Object containing any custom properties associated with the marker. */
|
|
71
|
+
getProperties(): object;
|
|
72
|
+
|
|
73
|
+
/** Merges an Object containing new properties into the marker's existing properties. */
|
|
74
|
+
setProperties(properties: object): void;
|
|
75
|
+
|
|
76
|
+
/** Returns whether this marker matches the given parameters. */
|
|
77
|
+
matchesProperties(attributes: FindDisplayMarkerOptions): boolean;
|
|
78
|
+
|
|
79
|
+
// Comparing to other markers
|
|
80
|
+
/** Compares this marker to another based on their ranges. */
|
|
81
|
+
compare(other: DisplayMarker): number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Returns a boolean indicating whether this marker is equivalent to another
|
|
85
|
+
* marker, meaning they have the same range and options.
|
|
86
|
+
*/
|
|
87
|
+
isEqual(other: DisplayMarker): boolean;
|
|
88
|
+
|
|
89
|
+
// Managing the marker's range
|
|
90
|
+
/** Gets the buffer range of this marker. */
|
|
91
|
+
getBufferRange(): Range;
|
|
92
|
+
|
|
93
|
+
/** Gets the screen range of this marker. */
|
|
94
|
+
getScreenRange(): Range;
|
|
95
|
+
|
|
96
|
+
/** Modifies the buffer range of this marker. */
|
|
97
|
+
setBufferRange(bufferRange: RangeCompatible, properties?: { reversed: boolean }): void;
|
|
98
|
+
|
|
99
|
+
/** Modifies the screen range of this marker. */
|
|
100
|
+
setScreenRange(
|
|
101
|
+
screenRange: RangeCompatible,
|
|
102
|
+
options?: { reversed?: boolean | undefined; clipDirection?: "backward" | "forward" | "closest" | undefined },
|
|
103
|
+
): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves the screen position of the marker's start. This will always be
|
|
107
|
+
* less than or equal to the result of DisplayMarker::getEndScreenPosition.
|
|
108
|
+
*/
|
|
109
|
+
getStartScreenPosition(options?: { clipDirection: "backward" | "forward" | "closest" }): Point;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Retrieves the screen position of the marker's end. This will always be
|
|
113
|
+
* greater than or equal to the result of {@link getStartScreenPosition}.
|
|
114
|
+
*/
|
|
115
|
+
getEndScreenPosition(options?: { clipDirection: "backward" | "forward" | "closest" }): Point;
|
|
116
|
+
|
|
117
|
+
/** Retrieves the buffer position of the marker's head. */
|
|
118
|
+
getHeadBufferPosition(): Point;
|
|
119
|
+
|
|
120
|
+
/** Sets the buffer position of the marker's head. */
|
|
121
|
+
setHeadBufferPosition(bufferPosition: PointCompatible): void;
|
|
122
|
+
|
|
123
|
+
/** Retrieves the screen position of the marker's head. */
|
|
124
|
+
getHeadScreenPosition(options?: { clipDirection: "backward" | "forward" | "closest" }): Point;
|
|
125
|
+
|
|
126
|
+
/** Sets the screen position of the marker's head. */
|
|
127
|
+
setHeadScreenPosition(
|
|
128
|
+
screenPosition: PointCompatible,
|
|
129
|
+
options?: { clipDirection: "backward" | "forward" | "closest" },
|
|
130
|
+
): void;
|
|
131
|
+
|
|
132
|
+
/** Retrieves the buffer position of the marker's tail. */
|
|
133
|
+
getTailBufferPosition(): Point;
|
|
134
|
+
|
|
135
|
+
/** Sets the buffer position of the marker's tail. */
|
|
136
|
+
setTailBufferPosition(bufferPosition: PointCompatible): void;
|
|
137
|
+
|
|
138
|
+
/** Retrieves the screen position of the marker's tail. */
|
|
139
|
+
getTailScreenPosition(options?: { clipDirection: "backward" | "forward" | "closest" }): Point;
|
|
140
|
+
|
|
141
|
+
/** Sets the screen position of the marker's tail. */
|
|
142
|
+
setTailScreenPosition(
|
|
143
|
+
screenPosition: PointCompatible,
|
|
144
|
+
options?: { clipDirection: "backward" | "forward" | "closest" },
|
|
145
|
+
): void;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Retrieves the buffer position of the marker's start. This will always be
|
|
149
|
+
* less than or equal to the result of DisplayMarker::getEndBufferPosition.
|
|
150
|
+
*/
|
|
151
|
+
getStartBufferPosition(): Point;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Retrieves the buffer position of the marker's end. This will always be
|
|
155
|
+
* greater than or equal to the result of
|
|
156
|
+
* DisplayMarker::getStartBufferPosition.
|
|
157
|
+
*/
|
|
158
|
+
getEndBufferPosition(): Point;
|
|
159
|
+
|
|
160
|
+
/** Returns a boolean indicating whether the marker has a tail. */
|
|
161
|
+
hasTail(): boolean;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Plants the marker's tail at the current head position. After calling the
|
|
165
|
+
* marker's tail position will be its head position at the time of the call,
|
|
166
|
+
* regardless of where the marker's head is moved.
|
|
167
|
+
*/
|
|
168
|
+
plantTail(): void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Removes the marker's tail. After calling the marker's head position will
|
|
172
|
+
* be reported as its current tail position until the tail is planted again.
|
|
173
|
+
*/
|
|
174
|
+
clearTail(): void;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface DisplayMarkerChangedEvent {
|
|
178
|
+
/** Point representing the former head buffer position. */
|
|
179
|
+
oldHeadBufferPosition: Point;
|
|
180
|
+
|
|
181
|
+
/** Point representing the new head buffer position. */
|
|
182
|
+
newHeadBufferPosition: Point;
|
|
183
|
+
|
|
184
|
+
// Point representing the former tail buffer position. */
|
|
185
|
+
oldTailBufferPosition: Point;
|
|
186
|
+
|
|
187
|
+
/** Point representing the new tail buffer position. */
|
|
188
|
+
newTailBufferPosition: Point;
|
|
189
|
+
|
|
190
|
+
/** Point representing the former head screen position. */
|
|
191
|
+
oldHeadScreenPosition: Point;
|
|
192
|
+
|
|
193
|
+
/** Point representing the new head screen position. */
|
|
194
|
+
newHeadScreenPosition: Point;
|
|
195
|
+
|
|
196
|
+
/** Point representing the former tail screen position. */
|
|
197
|
+
oldTailScreenPosition: Point;
|
|
198
|
+
|
|
199
|
+
/** Point representing the new tail screen position. */
|
|
200
|
+
newTailScreenPosition: Point;
|
|
201
|
+
|
|
202
|
+
/** Boolean indicating whether the marker was valid before the change. */
|
|
203
|
+
wasValid: boolean;
|
|
204
|
+
|
|
205
|
+
/** Boolean indicating whether the marker is now valid. */
|
|
206
|
+
isValid: boolean;
|
|
207
|
+
|
|
208
|
+
/** Boolean indicating whether the marker had a tail before the change. */
|
|
209
|
+
hadTail: boolean;
|
|
210
|
+
|
|
211
|
+
/** Boolean indicating whether the marker now has a tail */
|
|
212
|
+
hasTail: boolean;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Object containing the marker's custom properties before the change.
|
|
216
|
+
* @deprecated
|
|
217
|
+
*/
|
|
218
|
+
oldProperties: object;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Object containing the marker's custom properties after the change.
|
|
222
|
+
* @deprecated
|
|
223
|
+
*/
|
|
224
|
+
newProperties: object;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Boolean indicating whether this change was caused by a textual change to
|
|
228
|
+
* the buffer or whether the marker was manipulated directly via its public
|
|
229
|
+
* API.
|
|
230
|
+
*/
|
|
231
|
+
textChanged: boolean;
|
|
232
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Disposable } from "../../../index";
|
|
2
|
+
import { Marker, PointCompatible, RangeCompatible } from "./text-buffer";
|
|
3
|
+
|
|
4
|
+
/** Experimental: A container for a related set of markers. */
|
|
5
|
+
export interface MarkerLayer {
|
|
6
|
+
/** The identifier for this MarkerLayer. */
|
|
7
|
+
readonly id: string;
|
|
8
|
+
|
|
9
|
+
// Lifecycle
|
|
10
|
+
/** Create a copy of this layer with markers in the same state and locations. */
|
|
11
|
+
copy(): MarkerLayer;
|
|
12
|
+
|
|
13
|
+
/** Destroy this layer. */
|
|
14
|
+
destroy(): boolean;
|
|
15
|
+
|
|
16
|
+
/** Remove all markers from this layer. */
|
|
17
|
+
clear(): void;
|
|
18
|
+
|
|
19
|
+
/** Determine whether this layer has been destroyed. */
|
|
20
|
+
isDestroyed(): boolean;
|
|
21
|
+
|
|
22
|
+
// Querying
|
|
23
|
+
/** Get an existing marker by its id. */
|
|
24
|
+
getMarker(id: number): Marker | undefined;
|
|
25
|
+
|
|
26
|
+
/** Get all existing markers on the marker layer. */
|
|
27
|
+
getMarkers(): Marker[];
|
|
28
|
+
|
|
29
|
+
/** Get the number of markers in the marker layer. */
|
|
30
|
+
getMarkerCount(): number;
|
|
31
|
+
|
|
32
|
+
/** Find markers in the layer conforming to the given parameters. */
|
|
33
|
+
findMarkers(params: FindMarkerOptions): Marker[];
|
|
34
|
+
|
|
35
|
+
/** Get the role of the marker layer e.g. "atom.selection". */
|
|
36
|
+
getRole(): string | undefined;
|
|
37
|
+
|
|
38
|
+
// Marker Creation
|
|
39
|
+
/** Create a marker with the given range. */
|
|
40
|
+
markRange(
|
|
41
|
+
range: RangeCompatible,
|
|
42
|
+
options?: {
|
|
43
|
+
reversed?: boolean | undefined;
|
|
44
|
+
invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
|
|
45
|
+
exclusive?: boolean | undefined;
|
|
46
|
+
},
|
|
47
|
+
): Marker;
|
|
48
|
+
|
|
49
|
+
/** Create a marker at with its head at the given position with no tail. */
|
|
50
|
+
markPosition(
|
|
51
|
+
position: PointCompatible,
|
|
52
|
+
options?: {
|
|
53
|
+
invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
|
|
54
|
+
exclusive?: boolean | undefined;
|
|
55
|
+
},
|
|
56
|
+
): Marker;
|
|
57
|
+
|
|
58
|
+
// Event Subscription
|
|
59
|
+
/**
|
|
60
|
+
* Subscribe to be notified asynchronously whenever markers are created,
|
|
61
|
+
* updated, or destroyed on this layer.
|
|
62
|
+
*/
|
|
63
|
+
onDidUpdate(callback: () => void): Disposable;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Subscribe to be notified synchronously whenever markers are created on
|
|
67
|
+
* this layer.
|
|
68
|
+
*/
|
|
69
|
+
onDidCreateMarker(callback: (marker: Marker) => void): Disposable;
|
|
70
|
+
|
|
71
|
+
/** Subscribe to be notified synchronously when this layer is destroyed. */
|
|
72
|
+
onDidDestroy(callback: () => void): Disposable;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface FindMarkerOptions {
|
|
76
|
+
/** Only include markers that start at the given Point. */
|
|
77
|
+
startPosition?: PointCompatible | undefined;
|
|
78
|
+
|
|
79
|
+
/** Only include markers that end at the given Point. */
|
|
80
|
+
endPosition?: PointCompatible | undefined;
|
|
81
|
+
|
|
82
|
+
/** Only include markers that start inside the given Range. */
|
|
83
|
+
startsInRange?: RangeCompatible | undefined;
|
|
84
|
+
|
|
85
|
+
/** Only include markers that end inside the given Range. */
|
|
86
|
+
endsInRange?: RangeCompatible | undefined;
|
|
87
|
+
|
|
88
|
+
/** Only include markers that contain the given Point, inclusive. */
|
|
89
|
+
containsPoint?: PointCompatible | undefined;
|
|
90
|
+
containsPosition?: PointCompatible | undefined;
|
|
91
|
+
|
|
92
|
+
/** Only include markers that contain the given {@link Range}, inclusive. */
|
|
93
|
+
containsRange?: RangeCompatible | undefined;
|
|
94
|
+
|
|
95
|
+
/** Only include markers that intersect the given {@link Range}. */
|
|
96
|
+
intersectsRange?: RangeCompatible | undefined;
|
|
97
|
+
|
|
98
|
+
/** Only include markers that start at the given row number. */
|
|
99
|
+
startRow?: number | undefined;
|
|
100
|
+
|
|
101
|
+
/** Only include markers that end at the given row number. */
|
|
102
|
+
endRow?: number | undefined;
|
|
103
|
+
|
|
104
|
+
/** Only include markers that intersect the given row number. */
|
|
105
|
+
intersectsRow?: number | undefined;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Only include markers that intersect the given range of rows (given a
|
|
109
|
+
* two-item tuple describing the starting and ending rows).
|
|
110
|
+
*/
|
|
111
|
+
intersectsRowRange?: [number, number] | undefined;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Only include markers that are completely contained by the specified range.
|
|
115
|
+
*/
|
|
116
|
+
containedInRange?: RangeCompatible | undefined;
|
|
117
|
+
}
|