@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.
Files changed (87) hide show
  1. package/.github/workflows/publish.yml +33 -0
  2. package/LICENSE.md +8 -0
  3. package/README.md +187 -0
  4. package/atom-i18n/config.d.ts +9 -0
  5. package/atom-i18n/index.d.ts +4 -0
  6. package/autocomplete-plus/config.d.ts +140 -0
  7. package/autocomplete-plus/index.d.ts +200 -0
  8. package/dependencies/event-kit/index.d.ts +143 -0
  9. package/dependencies/first-mate/index.d.ts +1 -0
  10. package/dependencies/first-mate/src/first-mate.d.ts +1 -0
  11. package/dependencies/first-mate/src/grammar.d.ts +119 -0
  12. package/dependencies/pathwatcher/index.d.ts +1 -0
  13. package/dependencies/pathwatcher/src/directory.d.ts +98 -0
  14. package/dependencies/pathwatcher/src/file.d.ts +115 -0
  15. package/dependencies/pathwatcher/src/main.d.ts +2 -0
  16. package/dependencies/service-hub/index.d.ts +3 -0
  17. package/dependencies/service-hub/src/consumer.d.ts +8 -0
  18. package/dependencies/service-hub/src/provider.d.ts +14 -0
  19. package/dependencies/service-hub/src/service-hub.d.ts +46 -0
  20. package/dependencies/service-hub/src/util.d.ts +1 -0
  21. package/dependencies/text-buffer/index.d.ts +1 -0
  22. package/dependencies/text-buffer/src/display-marker-layer.d.ts +182 -0
  23. package/dependencies/text-buffer/src/display-marker.d.ts +232 -0
  24. package/dependencies/text-buffer/src/helpers.d.ts +11 -0
  25. package/dependencies/text-buffer/src/marker-layer.d.ts +117 -0
  26. package/dependencies/text-buffer/src/marker.d.ts +207 -0
  27. package/dependencies/text-buffer/src/point.d.ts +102 -0
  28. package/dependencies/text-buffer/src/range.d.ts +141 -0
  29. package/dependencies/text-buffer/src/text-buffer.d.ts +759 -0
  30. package/index.d.ts +72 -0
  31. package/linter/config.d.ts +26 -0
  32. package/linter/index.d.ts +108 -0
  33. package/package.json +61 -0
  34. package/src/atom-environment.d.ts +361 -0
  35. package/src/branding.d.ts +19 -0
  36. package/src/buffered-node-process.d.ts +10 -0
  37. package/src/buffered-process.d.ts +88 -0
  38. package/src/clipboard.d.ts +14 -0
  39. package/src/color.d.ts +11 -0
  40. package/src/command-registry.d.ts +118 -0
  41. package/src/config-schema.d.ts +271 -0
  42. package/src/config.d.ts +168 -0
  43. package/src/context-menu-manager.d.ts +65 -0
  44. package/src/cursor.d.ts +252 -0
  45. package/src/decoration.d.ts +156 -0
  46. package/src/deserializer-manager.d.ts +15 -0
  47. package/src/dock.d.ts +121 -0
  48. package/src/get-window-load-settings.d.ts +26 -0
  49. package/src/git-repository.d.ts +174 -0
  50. package/src/grammar-registry.d.ts +241 -0
  51. package/src/gutter.d.ts +118 -0
  52. package/src/history-manager.d.ts +28 -0
  53. package/src/keymap-extensions.d.ts +190 -0
  54. package/src/language-mode.d.ts +314 -0
  55. package/src/layer-decoration.d.ts +31 -0
  56. package/src/menu-manager.d.ts +24 -0
  57. package/src/notification-manager.d.ts +37 -0
  58. package/src/notification.d.ts +79 -0
  59. package/src/other-types.d.ts +283 -0
  60. package/src/package-manager.d.ts +103 -0
  61. package/src/package.d.ts +33 -0
  62. package/src/pane.d.ts +604 -0
  63. package/src/panel.d.ts +38 -0
  64. package/src/path-watcher.d.ts +35 -0
  65. package/src/project.d.ts +110 -0
  66. package/src/scope-descriptor.d.ts +8 -0
  67. package/src/selection.d.ts +341 -0
  68. package/src/style-manager.d.ts +68 -0
  69. package/src/task.d.ts +38 -0
  70. package/src/text-editor-component.d.ts +15 -0
  71. package/src/text-editor-element.d.ts +48 -0
  72. package/src/text-editor-registry.d.ts +48 -0
  73. package/src/text-editor.d.ts +1416 -0
  74. package/src/theme-manager.d.ts +29 -0
  75. package/src/tooltip-manager.d.ts +42 -0
  76. package/src/tooltip.d.ts +63 -0
  77. package/src/ui.d.ts +101 -0
  78. package/src/view-registry.d.ts +34 -0
  79. package/src/wasm-tree-sitter-grammar.d.ts +305 -0
  80. package/src/wasm-tree-sitter-language-mode.d.ts +294 -0
  81. package/src/workspace-center.d.ts +117 -0
  82. package/src/workspace.d.ts +485 -0
  83. package/status-bar/config.d.ts +23 -0
  84. package/status-bar/index.d.ts +51 -0
  85. package/tool-bar/config.d.ts +20 -0
  86. package/tool-bar/index.d.ts +235 -0
  87. package/tsconfig.json +8 -0
@@ -0,0 +1,207 @@
1
+ import { Disposable } from "../../../index";
2
+ import { Point, PointCompatible, Range, RangeCompatible } from "./text-buffer";
3
+
4
+ /**
5
+ * Represents a buffer annotation that remains logically stationary even as the
6
+ * buffer changes.
7
+ */
8
+ export interface Marker {
9
+ /** The identifier for this Marker. */
10
+ readonly id: number;
11
+
12
+ // Lifecycle
13
+ /**
14
+ * Creates and returns a new Marker with the same properties as this
15
+ * marker.
16
+ */
17
+ copy(options?: CopyMarkerOptions): Marker;
18
+
19
+ /** Destroys the marker, causing it to emit the "destroyed" event. */
20
+ destroy(): void;
21
+
22
+ // Event Subscription
23
+ /** Invoke the given callback when the marker is destroyed. */
24
+ onDidDestroy(callback: () => void): Disposable;
25
+
26
+ /** Invoke the given callback when the state of the marker changes. */
27
+ onDidChange(callback: (event: MarkerChangedEvent) => void): Disposable;
28
+
29
+ // Marker Details
30
+ /** Returns the current range of the marker. The range is immutable. */
31
+ getRange(): Range;
32
+
33
+ /** Returns a point representing the marker's current head position. */
34
+ getHeadPosition(): Point;
35
+
36
+ /** Returns a point representing the marker's current tail position. */
37
+ getTailPosition(): Point;
38
+
39
+ /**
40
+ * Returns a point representing the start position of the marker, which could
41
+ * be the head or tail position, depending on its orientation.
42
+ */
43
+ getStartPosition(): Point;
44
+
45
+ /**
46
+ * Returns a point representing the end position of the marker, which could
47
+ * be the head or tail position, depending on its orientation.
48
+ */
49
+ getEndPosition(): Point;
50
+
51
+ /** Returns a boolean indicating whether the head precedes the tail. */
52
+ isReversed(): boolean;
53
+
54
+ /** Returns a boolean indicating whether the marker has a tail. */
55
+ hasTail(): boolean;
56
+
57
+ /** Is the marker valid? */
58
+ isValid(): boolean;
59
+
60
+ /** Is the marker destroyed? */
61
+ isDestroyed(): boolean;
62
+
63
+ /**
64
+ * Returns a boolean indicating whether changes that occur exactly at the
65
+ * marker's head or tail cause it to move.
66
+ */
67
+ isExclusive(): boolean;
68
+
69
+ /** Get the invalidation strategy for this marker. */
70
+ getInvalidationStrategy(): string;
71
+
72
+ // Mutating Markers
73
+ /**
74
+ * Sets the range of the marker.
75
+ *
76
+ * Returns a boolean indicating whether or not the marker was updated.
77
+ */
78
+ setRange(
79
+ range: RangeCompatible,
80
+ params?: { reversed?: boolean | undefined; exclusive?: boolean | undefined },
81
+ ): boolean;
82
+
83
+ /**
84
+ * Sets the head position of the marker.
85
+ *
86
+ * Returns a boolean indicating whether or not the marker was updated.
87
+ */
88
+ setHeadPosition(position: PointCompatible): boolean;
89
+
90
+ /**
91
+ * Sets the tail position of the marker.
92
+ *
93
+ * Returns a boolean indicating whether or not the marker was updated.
94
+ */
95
+ setTailPosition(position: PointCompatible): boolean;
96
+
97
+ /**
98
+ * Removes the marker's tail.
99
+ *
100
+ * Returns a boolean indicating whether or not the marker was updated.
101
+ */
102
+ clearTail(): boolean;
103
+
104
+ /**
105
+ * Plants the marker's tail at the current head position.
106
+ *
107
+ * Returns a boolean indicating whether or not the marker was updated.
108
+ */
109
+ plantTail(): boolean;
110
+
111
+ // Comparison
112
+ /**
113
+ * Returns a boolean indicating whether this marker is equivalent to another
114
+ * marker, meaning they have the same range and options.
115
+ */
116
+ isEqual(other: Marker): boolean;
117
+
118
+ /**
119
+ * Compares this marker to another based on their ranges.
120
+ *
121
+ * Returns `-1` if this marker precedes the argument.
122
+ *
123
+ * Returns `0` if this marker is equivalent to the argument.
124
+ *
125
+ * Returns `1` if this marker follows the argument.
126
+ */
127
+ compare(other: Marker): number;
128
+
129
+ /**
130
+ * Merge an object containing new properties into the marker's existing
131
+ * properties. Use this to set custom data on your markers.
132
+ */
133
+ setProperties(properties: Record<string, unknown>);
134
+
135
+ /**
136
+ * Retrieve an object of key/value pairs that you set earlier via
137
+ * {@link setProperties}.
138
+ */
139
+ getProperties(): Record<string, unknown>;
140
+ }
141
+
142
+ export interface CopyMarkerOptions {
143
+ /** Whether or not the marker should be tailed. */
144
+ tailed?: boolean | undefined;
145
+
146
+ /** Creates the marker in a reversed orientation. */
147
+ reversed?: boolean | undefined;
148
+
149
+ /**
150
+ * Determines the rules by which changes to the buffer invalidate the marker.
151
+ */
152
+ invalidate?: "never" | "surround" | "overlap" | "inside" | "touch" | undefined;
153
+
154
+ /**
155
+ * Indicates whether insertions at the start or end of the marked range
156
+ * should be interpreted as happening outside the marker.
157
+ */
158
+ exclusive?: boolean | undefined;
159
+
160
+ /** Custom properties to be associated with the marker. */
161
+ properties?: object | undefined;
162
+ }
163
+
164
+ export interface MarkerChangedEvent {
165
+ /** Point representing the former head position. */
166
+ oldHeadPosition: Point;
167
+
168
+ /** Point representing the new head position. */
169
+ newHeadPosition: Point;
170
+
171
+ /** Point representing the former tail position. */
172
+ oldTailPosition: Point;
173
+
174
+ /** Point representing the new tail position. */
175
+ newTailPosition: Point;
176
+
177
+ /** Boolean indicating whether the marker was valid before the change. */
178
+ wasValid: boolean;
179
+
180
+ /** Boolean indicating whether the marker is now valid. */
181
+ isValid: boolean;
182
+
183
+ /** Boolean indicating whether the marker had a tail before the change. */
184
+ hadTail: boolean;
185
+
186
+ /** Boolean indicating whether the marker now has a tail. */
187
+ hasTail: boolean;
188
+
189
+ /**
190
+ * Object containing the marker's custom properties before the change.
191
+ * @deprecated
192
+ */
193
+ oldProperties: object;
194
+
195
+ /**
196
+ * Object containing the marker's custom properties after the change.
197
+ * @deprecated
198
+ */
199
+ newProperties: object;
200
+
201
+ /**
202
+ * Boolean indicating whether this change was caused by a textual change to
203
+ * the buffer or whether the marker was manipulated directly via its public
204
+ * API.
205
+ */
206
+ textChanged: boolean;
207
+ }
@@ -0,0 +1,102 @@
1
+ /** Represents a point in a buffer in row/column coordinates. */
2
+ export class Point {
3
+ // Properties
4
+ /** A zero-indexed number representing the row of the Point. */
5
+ row: number;
6
+
7
+ /** A zero-indexed number representing the column of the Point. */
8
+ column: number;
9
+
10
+ // Construction
11
+ /**
12
+ * Create a Point from an array containing two numbers representing the
13
+ * row and column.
14
+ */
15
+ static fromObject(object: PointCompatible, copy?: boolean): Point;
16
+
17
+ /** Construct a Point object */
18
+ constructor(row?: number, column?: number);
19
+
20
+ /** Returns a new Point with the same row and column. */
21
+ copy(): Point;
22
+
23
+ /** Returns a new Point with the row and column negated. */
24
+ negate(): Point;
25
+
26
+ // Comparison
27
+ /** Returns the given Point that is earlier in the buffer. */
28
+ static min(point1: PointCompatible, point2: PointCompatible): Point;
29
+
30
+ /**
31
+ * Compare another Point to this Point instance.
32
+ *
33
+ * Returns `-1` if this point precedes the argument.
34
+ *
35
+ * Returns `0` if this point is equivalent to the argument.
36
+ *
37
+ * Returns `1` if this point follows the argument.
38
+ */
39
+ compare(other: PointCompatible): number;
40
+
41
+ /**
42
+ * Returns a boolean indicating whether this point has the same row and column
43
+ * as the given Point.
44
+ */
45
+ isEqual(other: PointCompatible): boolean;
46
+
47
+ /**
48
+ * Returns a Boolean indicating whether this point precedes the given Point.
49
+ */
50
+ isLessThan(other: PointCompatible): boolean;
51
+
52
+ /**
53
+ * Returns whether this point precedes or is equal to the given Point.
54
+ */
55
+ isLessThanOrEqual(other: PointCompatible): boolean;
56
+
57
+ /** Returns a Boolean indicating whether this point follows the given Point. */
58
+ isGreaterThan(other: PointCompatible): boolean;
59
+
60
+ /**
61
+ * Returns a Boolean indicating whether this point follows or is equal to
62
+ * the given Point.
63
+ */
64
+ isGreaterThanOrEqual(other: PointCompatible): boolean;
65
+
66
+ // Operations
67
+ /** Makes this point immutable and returns itself. */
68
+ freeze(): Readonly<Point>;
69
+
70
+ /**
71
+ * Build and return a new point by adding the rows and columns of the given
72
+ * point.
73
+ */
74
+ translate(other: PointCompatible): Point;
75
+
76
+ /**
77
+ * Build and return a new Point by traversing the rows and columns specified
78
+ * by the given point.
79
+ */
80
+ traverse(other: PointCompatible): Point;
81
+
82
+ /** Returns an array of this point's row and column. */
83
+ toArray(): [number, number];
84
+
85
+ /** Returns an array of this point's row and column. */
86
+ serialize(): [number, number];
87
+
88
+ /** Returns a string representation of the point. */
89
+ toString(): string;
90
+ }
91
+
92
+ /** The interface that should be implemented for all "point-compatible" objects. */
93
+ export interface PointLike {
94
+ /** A zero-indexed number representing the row of the Point. */
95
+ row: number;
96
+
97
+ /** A zero-indexed number representing the column of the Point. */
98
+ column: number;
99
+ }
100
+
101
+ /** The types usable when constructing a point via the Point::fromObject method. */
102
+ export type PointCompatible = PointLike | [number, number];
@@ -0,0 +1,141 @@
1
+ import { Point, PointCompatible, PointLike } from "./text-buffer";
2
+
3
+ /** Represents a region in a buffer in row/column coordinates. */
4
+ export class Range {
5
+ // Properties
6
+ /** A Point representing the start of the Range. */
7
+ start: Point;
8
+
9
+ /** A Point representing the end of the Range. */
10
+ end: Point;
11
+
12
+ // Construction
13
+ /** Convert any range-compatible object to a Range. */
14
+ static fromObject(object: RangeCompatible, copy?: boolean): Range;
15
+
16
+ /** Construct a Range object. */
17
+ constructor(pointA?: PointCompatible, pointB?: PointCompatible);
18
+
19
+ /** Call this with the result of Range::serialize to construct a new Range. */
20
+ static deserialize(array: object): Range;
21
+
22
+ /** Returns a new range with the same start and end positions. */
23
+ copy(): Range;
24
+
25
+ /** Returns a new range with the start and end positions negated. */
26
+ negate(): Range;
27
+
28
+ // Serialization and Deserialization
29
+ /** Returns a plain javascript object representation of the Range. */
30
+ serialize(): number[][];
31
+
32
+ // Range Details
33
+ /** Is the start position of this range equal to the end position? */
34
+ isEmpty(): boolean;
35
+
36
+ /**
37
+ * Returns a boolean indicating whether this range starts and ends on the same
38
+ * row.
39
+ */
40
+ isSingleLine(): boolean;
41
+
42
+ /** Get the number of rows in this range. */
43
+ getRowCount(): number;
44
+
45
+ /** Returns an array of all rows in the range. */
46
+ getRows(): number[];
47
+
48
+ // Operations
49
+ /**
50
+ * Freezes the range and its start and end point so it becomes immutable and
51
+ * returns itself.
52
+ */
53
+ freeze(): Readonly<Range>;
54
+
55
+ // NOTE: this function doesn't actually take a range-compatible parameter.
56
+ /** Returns a new range that contains this range and the given range. */
57
+ union(other: RangeLike): Range;
58
+
59
+ /**
60
+ * Build and return a new range by translating this range's start and end
61
+ * points by the given delta(s).
62
+ */
63
+ translate(startDelta: PointCompatible, endDelta?: PointCompatible): Range;
64
+
65
+ /**
66
+ * Build and return a new range by traversing this range's start and end
67
+ * points by the given delta.
68
+ */
69
+ traverse(delta: PointCompatible): Range;
70
+
71
+ // Comparison
72
+ /**
73
+ * Compare two Ranges.
74
+ *
75
+ * Returns `-1` if this range starts before the argument or contains it.
76
+ *
77
+ * Returns `0` if this range is equivalent to the argument.
78
+ *
79
+ * Returns `1` if this range starts after the argument or is contained by it.
80
+ */
81
+ compare(otherRange: RangeCompatible): number;
82
+
83
+ /**
84
+ * Returns a Boolean indicating whether this range has the same start and end
85
+ * points as the given Range.
86
+ */
87
+ isEqual(otherRange: RangeCompatible): boolean;
88
+
89
+ // NOTE: this function doesn't actually take a range-compatible parameter.
90
+ /**
91
+ * Returns a Boolean indicating whether this range starts and ends on the
92
+ * same row as the argument.
93
+ */
94
+ coversSameRows(otherRange: RangeLike): boolean;
95
+
96
+ // NOTE: this function doesn't actually take a range-compatible parameter.
97
+ /** Determines whether this range intersects with the argument. */
98
+ intersectsWith(otherRange: RangeLike, exclusive?: boolean): boolean;
99
+
100
+ /** Returns a boolean indicating whether this range contains the given range. */
101
+ containsRange(otherRange: RangeCompatible, exclusive?: boolean): boolean;
102
+
103
+ /** Returns a boolean indicating whether this range contains the given point. */
104
+ containsPoint(point: PointCompatible, exclusive?: boolean): boolean;
105
+
106
+ /**
107
+ * Returns a boolean indicating whether this range intersects the given row
108
+ * number.
109
+ */
110
+ intersectsRow(row: number): boolean;
111
+
112
+ /**
113
+ * Returns a boolean indicating whether this range intersects the row range
114
+ * indicated by the given startRow and endRow numbers.
115
+ */
116
+ intersectsRowRange(startRow: number, endRow: number): boolean;
117
+
118
+ // Conversion
119
+ /** Returns a string representation of the range. */
120
+ toString(): string;
121
+ }
122
+
123
+ /**
124
+ * The types usable when constructing a range via the {@link Range#fromObject}
125
+ * method.
126
+ */
127
+ export type RangeCompatible =
128
+ | RangeLike
129
+ | [PointLike, PointLike]
130
+ | [PointLike, [number, number]]
131
+ | [[number, number], PointLike]
132
+ | [[number, number], [number, number]];
133
+
134
+ /** The interface that should be implemented for all "range-compatible" objects. */
135
+ export interface RangeLike {
136
+ /** A Point representing the start of the Range. */
137
+ start: PointLike;
138
+
139
+ /** A Point representing the end of the Range. */
140
+ end: PointLike;
141
+ }