Skip to content

Commit

Permalink
Docs: update for the new API release
Browse files Browse the repository at this point in the history
  • Loading branch information
raycastbot committed Feb 1, 2023
1 parent 5537d5e commit 49e975f
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.46.1"
"version": "1.47.0"
}
Binary file added docs/.gitbook/assets/deeplink-confirmation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- [Lifecycle](information/lifecycle/README.md)
- [Arguments](information/lifecycle/arguments.md)
- [Background Refresh](information/lifecycle/background-refresh.md)
- [Deeplinks](information/lifecycle/deeplinks.md)
- [Manifest](information/manifest.md)
- [Security](information/security.md)
- [Terminology](information/terminology.md)
Expand Down
46 changes: 45 additions & 1 deletion docs/api-reference/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,33 @@ export default async function Command() {

A Promise that resolves when the clipboard is cleared.

### Clipboard.read

Reads the clipboard content as plain text, file name, or HTML.

#### Signature

```typescript
async function read(): Promise<ReadContent>;
```

#### Example

```typescript
import { Clipboard } from "@raycast/api";

export default async () => {
const { text, file, html } = await Clipboard.read();
console.log(text);
console.log(file);
console.log(html);
};
```

#### Return

A promise that resolves when the clipboard content was read as plain text, file name, or HTML.

### Clipboard.readText

Reads the clipboard as plain text.
Expand Down Expand Up @@ -130,7 +157,7 @@ A promise that resolves when the clipboard content was read as plain text.

### Clipboard.Content

Type of Content that is copied and pasted to and from the Clipboard
Type of content that is copied and pasted to and from the Clipboard

```typescript
type Content =
Expand All @@ -141,3 +168,20 @@ type Content =
file: PathLike;
};
```

### Clipboard.ReadContent

Type of content that is read from the Clipboard

```typescript
type Content =
| {
text: string;
}
| {
file?: string;
}
| {
html?: string;
};
```
17 changes: 17 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 1.47.0 - 2023-02-01

### ✨ New

- **Clipboard**: Add a new `Clipboard.read()` method that reads the clipboard content as plain text, file path, or HTML.

### 💎 Improvements

- **List Accessories**: Tags can now use any color (we made some improvements to ensure that any color would have enough contrast to be readable)

### 🐞 Fixes

- Fixed a bug where reloading menu bar commands in development mode would not respect certain manifest property updates (e.g. interval).
- Fixed a bug that caused `Metadata.Link`'s `title` to be cut off unnecessarily when using the large text size.
- Fixed a bug where `clearSearchBar` wouldn’t clear the search bar when rendering a Grid.
- Fixed a bug where `ray lint` would fail if there were a .DS_Store file in the `src` folder.

## 1.46.0 - 2023-01-18

⚠️️ **Global Fetch Deprecation**: We've removed the experimental support for global fetch in Node 18. The reason is that the feature is not stable yet (hence the warning on it being "experimental" in the dev console) and is not compatible with our new proxy feature in Raycast. We've scanned the public repository for extensions that make use of global fetch and replaced it with the _cross-fetch_ dependency via separate PRs. If we missed an extension, let us know - in most cases, it should be a straightforward replacement.
Expand Down
1 change: 1 addition & 0 deletions docs/information/lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ There are different ways to launch a command:
- The command was launched in the [background](./background-refresh.md).
- A [Form's Draft](../../api-reference/user-interface/form.md#drafts) was saved and the user executes it.
- A user registers the command as a [fallback command](https://manual.raycast.com/fallback-commands) and executes it when there are no results in the root search.
- A user clicks a [Deeplink](./deeplinks.md)

Depending on how the command was launched, different arguments will be passed to the exported default function.

Expand Down
31 changes: 31 additions & 0 deletions docs/information/lifecycle/deeplinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Deeplinks

Deeplinks are Raycast-specific URLs which you can use to launch any command, as long as it's installed an enabled in Raycast.

They adhere the following format:

```
raycast://extensions/<author-or-owner>/<extension-name>/<command-name>
```

| Name | Description | Type |
| :-------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| author-or-owner | For store extensions, it's the value of the `owner` or the `author` field in the extension's [manifest](../manifest.md). For built-in extensions (such as `Calendar`), this is always `raycast`. | `string` |
| extension-name | For store extensions, it's the value of the extensions `name` field in the extension's [manifest](../manifest.md). For built-in extensions (such as `Calendar`), this is the "slugified" extension name; in this case `calendar`. | `string` |
| command-name | For store extensions, it's the value of the command's `name` field in the extension's [manifest](../manifest.md). For built-in commands (such as `My Schedule`), this is the "slugified" command name; in this case `my-schedule`. | `string` |

To make fetching a command's Deeplink easier, each command in the Raycast root now has a `Copy Deeplink` action.

{% hint style="info" %}
Whenever a command is launched using a Deeplink, Raycast will ask you to confirm that you want to run the command. This is to ensure that you are aware of the command you are running.
{% endhint %}

![](../../.gitbook/assets/deeplink-confirmation.png)

## Query Parameters

| Name | Description | Type |
| :--------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| launchType | Runs the command in the background, skipping bringing Raycast to the front. | Either `userInitiated` or `background` |
| arguments | If the command acepts [arguments](./arguments.md), they can be passed using this query parameter. | URL-encoded JSON object. |
| context | If the command make use of [LaunchContext](../../api-reference/utilities.md#launchcontext), it can be passed using this query parameter. | URL-encoded JSON object. |

0 comments on commit 49e975f

Please sign in to comment.