Skip to content

Commit 5a8ac27

Browse files
chore(release): 1.1.0 [skip ci]
1 parent e94505a commit 5a8ac27

13 files changed

+422
-2
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# [1.1.0](https://github.com/atom-ide-community/atom-ide-base/compare/v1.0.0...v1.1.0) (2020-07-21)
2+
3+
4+
### Bug Fixes
5+
6+
* add description to package.json ([e94505a](https://github.com/atom-ide-community/atom-ide-base/commit/e94505a63658299103c931b3f83baa64c7a13cd6))
7+
* add readme about the types ([18eb027](https://github.com/atom-ide-community/atom-ide-base/commit/18eb027b6eba2e0ceffba3f0ca27a259ac35f088))
8+
* add types scripts ([b99f92b](https://github.com/atom-ide-community/atom-ide-base/commit/b99f92bb0f01557989bde9ccf07b52341c034f85))
9+
* rename index.d.ts ([7d2e5ed](https://github.com/atom-ide-community/atom-ide-base/commit/7d2e5ed91b894dee3934f8eb6ba7bd64be17a662))
10+
* use normal typescript syntax ([fe40ec2](https://github.com/atom-ide-community/atom-ide-base/commit/fe40ec2d6c0a193899bb5d5308ab45ceb8498295))
11+
12+
13+
### Features
14+
15+
* add npm release to allow using types ([806b9a5](https://github.com/atom-ide-community/atom-ide-base/commit/806b9a51f6aa39dfb417afc5c34bcfb3c1dfb912))
16+
117
# 1.0.0 (2020-07-21)
218

319

dist/busy-signal.d.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// declare module "atom-ide-base" {
2+
export interface BusySignalOptions {
3+
// Can say that a busy signal will only appear when a given file is open.
4+
// Default = `null`, meaning the busy signal applies to all files.
5+
onlyForFile?: string;
6+
// Is user waiting for computer to finish a task? (traditional busy spinner)
7+
// or is the computer waiting for user to finish a task? (action required)
8+
// Default = spinner.
9+
waitingFor?: "computer" | "user";
10+
// Debounce it? default = `true` for busy-signal, and false for action-required.
11+
debounce?: boolean;
12+
// If `onClick` is set, then the tooltip will be clickable. Default = `null`.
13+
onDidClick?: () => void;
14+
// If set to `true`, the busy signal tooltip will be immediately revealed
15+
// when it first becomes visible (without explicit mouse interaction).
16+
revealTooltip?: boolean;
17+
}
18+
19+
export interface BusySignalService {
20+
// Activates the busy signal with the given title and returns the promise
21+
// from the provided callback.
22+
// The busy signal automatically deactivates when the returned promise
23+
// either resolves or rejects.
24+
reportBusyWhile<T>(
25+
title: string,
26+
f: () => Promise<T>,
27+
options?: BusySignalOptions
28+
): Promise<T>;
29+
30+
// Activates the busy signal. Set the title in the returned BusySignal
31+
// object (you can update the title multiple times) and dispose it when done.
32+
reportBusy(title: string, options?: BusySignalOptions): BusyMessage;
33+
34+
// This is a no-op. When someone consumes the busy service, they get back a
35+
// reference to the single shared instance, so disposing of it would be wrong.
36+
dispose(): void;
37+
}
38+
39+
export interface BusyMessage {
40+
// You can set/update the title.
41+
setTitle(title: string): void;
42+
// Dispose of the signal when done to make it go away.
43+
dispose(): void;
44+
}
45+
// }

dist/code-actions.d.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as Atom from "atom";
2+
import { Message } from "atom/linter";
3+
4+
export interface CodeAction {
5+
apply(): Promise<void>;
6+
getTitle(): Promise<string>;
7+
dispose(): void;
8+
}
9+
10+
export interface CodeActionProvider {
11+
grammarScopes?: ReadonlyArray<string>;
12+
priority: number;
13+
getCodeActions(
14+
editor: Atom.TextEditor,
15+
range: Atom.Range,
16+
diagnostics: Message[]
17+
): Promise<CodeAction[] | null | undefined>;
18+
}
19+
20+
/**
21+
* atom-ide-base-code-actions provides a CodeActionFetcher which offers an API to
22+
* request CodeActions from all CodeAction providers. For now, CodeActionFetcher
23+
* can only fetch CodeActions for a Diagnostic. In the future, this API can be
24+
* extended to provide a stream of CodeActions based on the cursor position.
25+
*/
26+
export interface CodeActionFetcher {
27+
getCodeActionForDiagnostic: (
28+
diagnostic: Message,
29+
editor: Atom.TextEditor
30+
) => Promise<CodeAction[]>;
31+
}

dist/code-highlight.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Atom from "atom";
2+
3+
export interface CodeHighlightProvider {
4+
priority: number;
5+
grammarScopes: ReadonlyArray<string>;
6+
highlight(
7+
editor: Atom.TextEditor,
8+
bufferPosition: Atom.Point
9+
): Promise<Atom.Range[] | undefined | null>;
10+
}

dist/datatip.d.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import * as Atom from "atom";
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+
}
12+
13+
export interface PinnedDatatipOptions {
14+
// Defaults to 'end-of-line'.
15+
position?: PinnedDatatipPosition;
16+
// Defaults to true.
17+
showRangeHighlight?: boolean;
18+
}
19+
20+
export type PinnedDatatipPosition = "end-of-line" | "above-range";
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+
}
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+
}
44+
45+
export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider;
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+
};
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+
};
70+
71+
export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey";

dist/definitions.d.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import * as Atom from "atom";
2+
3+
export interface Definition {
4+
// Path of the file in which the definition is located.
5+
path: string;
6+
// First character of the definition's identifier.
7+
// e.g. "F" in `class Foo {}`
8+
position: Atom.Point;
9+
// Optional: the range of the entire definition.
10+
// e.g. "c" to "}" in `class Foo {}`
11+
range?: Atom.Range;
12+
// Optional: `name` and `projectRoot` can be provided to display a more human-readable title
13+
// inside of Hyperclick when there are multiple definitions.
14+
name?: string;
15+
// If provided, `projectRoot` will be used to display a relativized version of `path`.
16+
projectRoot?: string;
17+
// `language` may be used by consumers to identify the source of definitions.
18+
language: string;
19+
}
20+
21+
// Definition queries supply a point.
22+
// The returned queryRange is the range within which the returned definition is valid.
23+
// Typically queryRange spans the containing identifier around the query point.
24+
// (If a null queryRange is returned, the range of the word containing the point is used.)
25+
export interface DefinitionQueryResult {
26+
queryRange: ReadonlyArray<Atom.Range> | null | undefined;
27+
definitions: ReadonlyArray<Definition>; // Must be non-empty.
28+
}
29+
30+
// Provides definitions for a set of language grammars.
31+
export interface DefinitionProvider {
32+
// If there are multiple providers for a given grammar,
33+
// the one with the highest priority will be used.
34+
priority: number;
35+
grammarScopes: ReadonlyArray<string>;
36+
wordRegExp: RegExp | null | undefined;
37+
// Obtains the definition in an editor at the given point.
38+
// This should return null if no definition is available.
39+
getDefinition: (
40+
editor: Atom.TextEditor,
41+
position: Atom.Point
42+
) => Promise<DefinitionQueryResult | null | undefined>;
43+
}
44+
45+
export interface DefinitionPreviewProvider {
46+
getDefinitionPreview(
47+
definition: Definition
48+
): Promise<
49+
| {
50+
mime: string;
51+
contents: string;
52+
encoding: string;
53+
}
54+
| null
55+
| undefined
56+
>;
57+
}

dist/find-references.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as Atom from "atom";
2+
3+
export interface FindReferencesProvider {
4+
// Return true if your provider supports finding references for the provided Atom.TextEditor.
5+
isEditorSupported(editor: Atom.TextEditor): Promise<boolean>;
6+
7+
// `findReferences` will only be called if `isEditorSupported` previously returned true
8+
// for the given Atom.TextEditor.
9+
findReferences(
10+
editor: Atom.TextEditor,
11+
position: Atom.Point
12+
): Promise<FindReferencesReturn | undefined | null>;
13+
}
14+
15+
export interface Reference {
16+
uri: string; // Nuclide URI of the file path
17+
name: string | undefined | null; // name of calling method/function/symbol
18+
range: Atom.Range;
19+
}
20+
21+
export interface FindReferencesData {
22+
type: "data";
23+
baseUri: string;
24+
referencedSymbolName: string;
25+
references: Reference[];
26+
title?: string; // defaults to 'Symbol References'
27+
}
28+
29+
export interface FindReferencesError {
30+
type: "error";
31+
message: string;
32+
}
33+
34+
export type FindReferencesReturn = FindReferencesData | FindReferencesError;

dist/hyperclick.d.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as Atom from "atom";
2+
3+
export interface HyperclickProvider {
4+
// Use this to provide a suggestion for single-word matches.
5+
// Optionally set `wordRegExp` to adjust word-matching.
6+
getSuggestionForWord?: (
7+
textEditor: Atom.TextEditor,
8+
text: string,
9+
range: Atom.Range
10+
) => Promise<HyperclickSuggestion | null | undefined>;
11+
12+
wordRegExp?: RegExp;
13+
14+
// Use this to provide a suggestion if it can have non-contiguous ranges.
15+
// A primary use-case for this is Objective-C methods.
16+
getSuggestion?: (
17+
textEditor: Atom.TextEditor,
18+
position: Atom.Point
19+
) => Promise<HyperclickSuggestion | null | undefined>;
20+
21+
// Must be unique. Used for analytics.
22+
providerName?: string;
23+
24+
// The higher this is, the more precedence the provider gets.
25+
priority: number;
26+
27+
// Optionally, limit the set of grammar scopes the provider should apply to.
28+
grammarScopes?: string[];
29+
}
30+
31+
export interface HyperclickSuggestion {
32+
// The range(s) to underline to provide as a visual cue for clicking.
33+
range: Atom.Range | Atom.Range[];
34+
35+
// The function to call when the underlined text is clicked.
36+
callback:
37+
| (() => void)
38+
| Array<{ rightLabel?: string; title: string; callback: () => void }>;
39+
}

dist/main.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// atom-ide
2+
// https://github.com/atom-ide-community/atom-ide-base
3+
4+
export * from "./busy-signal"
5+
export * from "./code-actions"
6+
export * from "./code-highlight"
7+
export * from "./datatip"
8+
export * from "./definitions"
9+
export * from "./find-references"
10+
export * from "./hyperclick"
11+
export * from "./outline"
12+
export * from "./sig-help"

dist/outline.d.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import * as Atom from "atom";
2+
3+
export interface OutlineProvider {
4+
name: string;
5+
// If there are multiple providers for a given grammar, the one with the highest priority will be
6+
// used.
7+
priority: number;
8+
grammarScopes: ReadonlyArray<string>;
9+
updateOnEdit?: boolean;
10+
getOutline(editor: Atom.TextEditor): Promise<Outline | null | undefined>;
11+
}
12+
13+
export interface OutlineTree {
14+
icon?: string; // from Atom.Octicon (that type's not allowed over rpc so we use string)
15+
kind?: OutlineTreeKind; // kind you can pass to the UI for theming
16+
17+
// Must be one or the other. If both are present, tokenizedText is preferred.
18+
plainText?: string;
19+
tokenizedText?: TokenizedText;
20+
21+
// If user has atom-ide-base-outline-view.nameOnly then representativeName is used instead.
22+
representativeName?: string;
23+
24+
startPosition: Atom.Point;
25+
endPosition?: Atom.Point;
26+
landingPosition?: Atom.Point;
27+
children: OutlineTree[];
28+
}
29+
30+
export interface Outline {
31+
outlineTrees: OutlineTree[];
32+
}
33+
34+
// Kind of outline tree - matches the names from the Language Server Protocol v2.
35+
export type OutlineTreeKind =
36+
| "file"
37+
| "module"
38+
| "namespace"
39+
| "package"
40+
| "class"
41+
| "method"
42+
| "property"
43+
| "field"
44+
| "constructor"
45+
| "enum"
46+
| "interface"
47+
| "function"
48+
| "variable"
49+
| "constant"
50+
| "string"
51+
| "number"
52+
| "boolean"
53+
| "array";
54+
55+
export type TokenKind =
56+
| "keyword"
57+
| "class-name"
58+
| "constructor"
59+
| "method"
60+
| "param"
61+
| "string"
62+
| "whitespace"
63+
| "plain"
64+
| "type";
65+
66+
export interface TextToken {
67+
kind: TokenKind;
68+
value: string;
69+
}
70+
71+
export type TokenizedText = TextToken[];

0 commit comments

Comments
 (0)