|
1 | 1 | import * as Atom from "atom"; |
2 | 2 |
|
3 | | - export interface DatatipService { |
4 | | - addProvider(provider: DatatipProvider): Atom.DisposableLike; |
5 | | - addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike; |
6 | | - createPinnedDataTip( |
7 | | - datatip: Datatip, |
8 | | - editor: Atom.TextEditor, |
9 | | - options?: PinnedDatatipOptions |
10 | | - ): Atom.DisposableLike; |
11 | | - } |
| 3 | +export interface DatatipService { |
| 4 | + addProvider(provider: DatatipProvider): Atom.DisposableLike; |
| 5 | + addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike; |
| 6 | + createPinnedDataTip( |
| 7 | + datatip: Datatip, |
| 8 | + editor: Atom.TextEditor, |
| 9 | + options?: PinnedDatatipOptions |
| 10 | + ): Atom.DisposableLike; |
| 11 | +} |
12 | 12 |
|
13 | | - export interface PinnedDatatipOptions { |
14 | | - // Defaults to 'end-of-line'. |
15 | | - position?: PinnedDatatipPosition; |
16 | | - // Defaults to true. |
17 | | - showRangeHighlight?: boolean; |
18 | | - } |
| 13 | +export interface PinnedDatatipOptions { |
| 14 | + // Defaults to 'end-of-line'. |
| 15 | + position?: PinnedDatatipPosition; |
| 16 | + // Defaults to true. |
| 17 | + showRangeHighlight?: boolean; |
| 18 | +} |
19 | 19 |
|
20 | | - export type PinnedDatatipPosition = "end-of-line" | "above-range"; |
| 20 | +export type PinnedDatatipPosition = "end-of-line" | "above-range"; |
21 | 21 |
|
22 | | - export interface DatatipProvider { |
23 | | - priority: number; |
24 | | - grammarScopes?: ReadonlyArray<string>; |
25 | | - // A unique name for the provider to be used for analytics. |
26 | | - // It is recommended that it be the name of the provider's package. |
27 | | - providerName: string; |
28 | | - datatip( |
29 | | - editor: Atom.TextEditor, |
30 | | - bufferPosition: Atom.Point |
31 | | - ): Promise<Datatip | undefined | null>; |
32 | | - } |
| 22 | +export interface DatatipProvider { |
| 23 | + priority: number; |
| 24 | + grammarScopes?: ReadonlyArray<string>; |
| 25 | + // A unique name for the provider to be used for analytics. |
| 26 | + // It is recommended that it be the name of the provider's package. |
| 27 | + providerName: string; |
| 28 | + datatip( |
| 29 | + editor: Atom.TextEditor, |
| 30 | + bufferPosition: Atom.Point |
| 31 | + ): Promise<Datatip | undefined | null>; |
| 32 | +} |
33 | 33 |
|
34 | | - export interface ModifierDatatipProvider { |
35 | | - priority: number; |
36 | | - grammarScopes?: string[]; |
37 | | - providerName: string; |
38 | | - modifierDatatip( |
39 | | - editor: Atom.TextEditor, |
40 | | - bufferPosition: Atom.Point, |
41 | | - heldKeys: Set<ModifierKey> |
42 | | - ): Promise<Datatip | undefined | null>; |
43 | | - } |
| 34 | +export interface ModifierDatatipProvider { |
| 35 | + priority: number; |
| 36 | + grammarScopes?: string[]; |
| 37 | + providerName: string; |
| 38 | + modifierDatatip( |
| 39 | + editor: Atom.TextEditor, |
| 40 | + bufferPosition: Atom.Point, |
| 41 | + heldKeys: Set<ModifierKey> |
| 42 | + ): Promise<Datatip | undefined | null>; |
| 43 | +} |
44 | 44 |
|
45 | | - export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider; |
| 45 | +export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider; |
46 | 46 |
|
47 | | - export type Datatip = |
48 | | - | { |
49 | | - markedStrings: MarkedString[]; |
50 | | - range: Atom.Range; |
51 | | - pinnable?: boolean; |
52 | | - } |
53 | | - | { |
54 | | - component: () => JSX.Element; // React component |
55 | | - range: Atom.Range; |
56 | | - pinnable?: boolean; |
57 | | - }; |
| 47 | +export type Datatip = |
| 48 | + | { |
| 49 | + markedStrings: MarkedString[]; |
| 50 | + range: Atom.Range; |
| 51 | + pinnable?: boolean; |
| 52 | + } |
| 53 | + | { |
| 54 | + component: () => JSX.Element; // React component |
| 55 | + range: Atom.Range; |
| 56 | + pinnable?: boolean; |
| 57 | + }; |
58 | 58 |
|
59 | | - // Borrowed from the LSP API. |
60 | | - export type MarkedString = |
61 | | - | { |
62 | | - type: "markdown"; |
63 | | - value: string; |
64 | | - } |
65 | | - | { |
66 | | - type: "snippet"; |
67 | | - grammar: Atom.Grammar; |
68 | | - value: string; |
69 | | - }; |
| 59 | +// Borrowed from the LSP API. |
| 60 | +export type MarkedString = |
| 61 | + | { |
| 62 | + type: "markdown"; |
| 63 | + value: string; |
| 64 | + } |
| 65 | + | { |
| 66 | + type: "snippet"; |
| 67 | + grammar: Atom.Grammar; |
| 68 | + value: string; |
| 69 | + }; |
70 | 70 |
|
71 | | - export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey"; |
| 71 | +export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey"; |
0 commit comments