Skip to content

Commit

Permalink
chore(release): 1.1.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Jul 21, 2020
1 parent e94505a commit 5a8ac27
Show file tree
Hide file tree
Showing 13 changed files with 422 additions and 2 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# [1.1.0](https://github.com/atom-ide-community/atom-ide-base/compare/v1.0.0...v1.1.0) (2020-07-21)


### Bug Fixes

* add description to package.json ([e94505a](https://github.com/atom-ide-community/atom-ide-base/commit/e94505a63658299103c931b3f83baa64c7a13cd6))
* add readme about the types ([18eb027](https://github.com/atom-ide-community/atom-ide-base/commit/18eb027b6eba2e0ceffba3f0ca27a259ac35f088))
* add types scripts ([b99f92b](https://github.com/atom-ide-community/atom-ide-base/commit/b99f92bb0f01557989bde9ccf07b52341c034f85))
* rename index.d.ts ([7d2e5ed](https://github.com/atom-ide-community/atom-ide-base/commit/7d2e5ed91b894dee3934f8eb6ba7bd64be17a662))
* use normal typescript syntax ([fe40ec2](https://github.com/atom-ide-community/atom-ide-base/commit/fe40ec2d6c0a193899bb5d5308ab45ceb8498295))


### Features

* add npm release to allow using types ([806b9a5](https://github.com/atom-ide-community/atom-ide-base/commit/806b9a51f6aa39dfb417afc5c34bcfb3c1dfb912))

# 1.0.0 (2020-07-21)


Expand Down
45 changes: 45 additions & 0 deletions dist/busy-signal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// declare module "atom-ide-base" {
export interface BusySignalOptions {
// Can say that a busy signal will only appear when a given file is open.
// Default = `null`, meaning the busy signal applies to all files.
onlyForFile?: string;
// Is user waiting for computer to finish a task? (traditional busy spinner)
// or is the computer waiting for user to finish a task? (action required)
// Default = spinner.
waitingFor?: "computer" | "user";
// Debounce it? default = `true` for busy-signal, and false for action-required.
debounce?: boolean;
// If `onClick` is set, then the tooltip will be clickable. Default = `null`.
onDidClick?: () => void;
// If set to `true`, the busy signal tooltip will be immediately revealed
// when it first becomes visible (without explicit mouse interaction).
revealTooltip?: boolean;
}

export interface BusySignalService {
// Activates the busy signal with the given title and returns the promise
// from the provided callback.
// The busy signal automatically deactivates when the returned promise
// either resolves or rejects.
reportBusyWhile<T>(
title: string,
f: () => Promise<T>,
options?: BusySignalOptions
): Promise<T>;

// Activates the busy signal. Set the title in the returned BusySignal
// object (you can update the title multiple times) and dispose it when done.
reportBusy(title: string, options?: BusySignalOptions): BusyMessage;

// This is a no-op. When someone consumes the busy service, they get back a
// reference to the single shared instance, so disposing of it would be wrong.
dispose(): void;
}

export interface BusyMessage {
// You can set/update the title.
setTitle(title: string): void;
// Dispose of the signal when done to make it go away.
dispose(): void;
}
// }
31 changes: 31 additions & 0 deletions dist/code-actions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as Atom from "atom";
import { Message } from "atom/linter";

export interface CodeAction {
apply(): Promise<void>;
getTitle(): Promise<string>;
dispose(): void;
}

export interface CodeActionProvider {
grammarScopes?: ReadonlyArray<string>;
priority: number;
getCodeActions(
editor: Atom.TextEditor,
range: Atom.Range,
diagnostics: Message[]
): Promise<CodeAction[] | null | undefined>;
}

/**
* atom-ide-base-code-actions provides a CodeActionFetcher which offers an API to
* request CodeActions from all CodeAction providers. For now, CodeActionFetcher
* can only fetch CodeActions for a Diagnostic. In the future, this API can be
* extended to provide a stream of CodeActions based on the cursor position.
*/
export interface CodeActionFetcher {
getCodeActionForDiagnostic: (
diagnostic: Message,
editor: Atom.TextEditor
) => Promise<CodeAction[]>;
}
10 changes: 10 additions & 0 deletions dist/code-highlight.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as Atom from "atom";

export interface CodeHighlightProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
highlight(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Atom.Range[] | undefined | null>;
}
71 changes: 71 additions & 0 deletions dist/datatip.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import * as Atom from "atom";

export interface DatatipService {
addProvider(provider: DatatipProvider): Atom.DisposableLike;
addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike;
createPinnedDataTip(
datatip: Datatip,
editor: Atom.TextEditor,
options?: PinnedDatatipOptions
): Atom.DisposableLike;
}

export interface PinnedDatatipOptions {
// Defaults to 'end-of-line'.
position?: PinnedDatatipPosition;
// Defaults to true.
showRangeHighlight?: boolean;
}

export type PinnedDatatipPosition = "end-of-line" | "above-range";

export interface DatatipProvider {
priority: number;
grammarScopes?: ReadonlyArray<string>;
// A unique name for the provider to be used for analytics.
// It is recommended that it be the name of the provider's package.
providerName: string;
datatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Datatip | undefined | null>;
}

export interface ModifierDatatipProvider {
priority: number;
grammarScopes?: string[];
providerName: string;
modifierDatatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point,
heldKeys: Set<ModifierKey>
): Promise<Datatip | undefined | null>;
}

export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider;

export type Datatip =
| {
markedStrings: MarkedString[];
range: Atom.Range;
pinnable?: boolean;
}
| {
component: () => JSX.Element; // React component
range: Atom.Range;
pinnable?: boolean;
};

// Borrowed from the LSP API.
export type MarkedString =
| {
type: "markdown";
value: string;
}
| {
type: "snippet";
grammar: Atom.Grammar;
value: string;
};

export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey";
57 changes: 57 additions & 0 deletions dist/definitions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import * as Atom from "atom";

export interface Definition {
// Path of the file in which the definition is located.
path: string;
// First character of the definition's identifier.
// e.g. "F" in `class Foo {}`
position: Atom.Point;
// Optional: the range of the entire definition.
// e.g. "c" to "}" in `class Foo {}`
range?: Atom.Range;
// Optional: `name` and `projectRoot` can be provided to display a more human-readable title
// inside of Hyperclick when there are multiple definitions.
name?: string;
// If provided, `projectRoot` will be used to display a relativized version of `path`.
projectRoot?: string;
// `language` may be used by consumers to identify the source of definitions.
language: string;
}

// Definition queries supply a point.
// The returned queryRange is the range within which the returned definition is valid.
// Typically queryRange spans the containing identifier around the query point.
// (If a null queryRange is returned, the range of the word containing the point is used.)
export interface DefinitionQueryResult {
queryRange: ReadonlyArray<Atom.Range> | null | undefined;
definitions: ReadonlyArray<Definition>; // Must be non-empty.
}

// Provides definitions for a set of language grammars.
export interface DefinitionProvider {
// If there are multiple providers for a given grammar,
// the one with the highest priority will be used.
priority: number;
grammarScopes: ReadonlyArray<string>;
wordRegExp: RegExp | null | undefined;
// Obtains the definition in an editor at the given point.
// This should return null if no definition is available.
getDefinition: (
editor: Atom.TextEditor,
position: Atom.Point
) => Promise<DefinitionQueryResult | null | undefined>;
}

export interface DefinitionPreviewProvider {
getDefinitionPreview(
definition: Definition
): Promise<
| {
mime: string;
contents: string;
encoding: string;
}
| null
| undefined
>;
}
34 changes: 34 additions & 0 deletions dist/find-references.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import * as Atom from "atom";

export interface FindReferencesProvider {
// Return true if your provider supports finding references for the provided Atom.TextEditor.
isEditorSupported(editor: Atom.TextEditor): Promise<boolean>;

// `findReferences` will only be called if `isEditorSupported` previously returned true
// for the given Atom.TextEditor.
findReferences(
editor: Atom.TextEditor,
position: Atom.Point
): Promise<FindReferencesReturn | undefined | null>;
}

export interface Reference {
uri: string; // Nuclide URI of the file path
name: string | undefined | null; // name of calling method/function/symbol
range: Atom.Range;
}

export interface FindReferencesData {
type: "data";
baseUri: string;
referencedSymbolName: string;
references: Reference[];
title?: string; // defaults to 'Symbol References'
}

export interface FindReferencesError {
type: "error";
message: string;
}

export type FindReferencesReturn = FindReferencesData | FindReferencesError;
39 changes: 39 additions & 0 deletions dist/hyperclick.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as Atom from "atom";

export interface HyperclickProvider {
// Use this to provide a suggestion for single-word matches.
// Optionally set `wordRegExp` to adjust word-matching.
getSuggestionForWord?: (
textEditor: Atom.TextEditor,
text: string,
range: Atom.Range
) => Promise<HyperclickSuggestion | null | undefined>;

wordRegExp?: RegExp;

// Use this to provide a suggestion if it can have non-contiguous ranges.
// A primary use-case for this is Objective-C methods.
getSuggestion?: (
textEditor: Atom.TextEditor,
position: Atom.Point
) => Promise<HyperclickSuggestion | null | undefined>;

// Must be unique. Used for analytics.
providerName?: string;

// The higher this is, the more precedence the provider gets.
priority: number;

// Optionally, limit the set of grammar scopes the provider should apply to.
grammarScopes?: string[];
}

export interface HyperclickSuggestion {
// The range(s) to underline to provide as a visual cue for clicking.
range: Atom.Range | Atom.Range[];

// The function to call when the underlined text is clicked.
callback:
| (() => void)
| Array<{ rightLabel?: string; title: string; callback: () => void }>;
}
12 changes: 12 additions & 0 deletions dist/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// atom-ide
// https://github.com/atom-ide-community/atom-ide-base

export * from "./busy-signal"
export * from "./code-actions"
export * from "./code-highlight"
export * from "./datatip"
export * from "./definitions"
export * from "./find-references"
export * from "./hyperclick"
export * from "./outline"
export * from "./sig-help"
71 changes: 71 additions & 0 deletions dist/outline.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import * as Atom from "atom";

export interface OutlineProvider {
name: string;
// If there are multiple providers for a given grammar, the one with the highest priority will be
// used.
priority: number;
grammarScopes: ReadonlyArray<string>;
updateOnEdit?: boolean;
getOutline(editor: Atom.TextEditor): Promise<Outline | null | undefined>;
}

export interface OutlineTree {
icon?: string; // from Atom.Octicon (that type's not allowed over rpc so we use string)
kind?: OutlineTreeKind; // kind you can pass to the UI for theming

// Must be one or the other. If both are present, tokenizedText is preferred.
plainText?: string;
tokenizedText?: TokenizedText;

// If user has atom-ide-base-outline-view.nameOnly then representativeName is used instead.
representativeName?: string;

startPosition: Atom.Point;
endPosition?: Atom.Point;
landingPosition?: Atom.Point;
children: OutlineTree[];
}

export interface Outline {
outlineTrees: OutlineTree[];
}

// Kind of outline tree - matches the names from the Language Server Protocol v2.
export type OutlineTreeKind =
| "file"
| "module"
| "namespace"
| "package"
| "class"
| "method"
| "property"
| "field"
| "constructor"
| "enum"
| "interface"
| "function"
| "variable"
| "constant"
| "string"
| "number"
| "boolean"
| "array";

export type TokenKind =
| "keyword"
| "class-name"
| "constructor"
| "method"
| "param"
| "string"
| "whitespace"
| "plain"
| "type";

export interface TextToken {
kind: TokenKind;
value: string;
}

export type TokenizedText = TextToken[];
Loading

0 comments on commit 5a8ac27

Please sign in to comment.