v1.28.0
This version contains an overhaul of the API surface to improve its discoverability and its usage in a code editor. The aim was to reduce the number of top-level exports to make it easier to find the ones that matter. It also aligns it with the structure of the documentation.
Clipboard
The methods related to the Clipboard can now be found under the Clipboard namespace.
import { Clipboard } from "@raycast/api";
// deprecated copyTextToClipboard
await Clipboard.copy("text");
// deprecated clearClipboard
await Clipboard.clear();
// deprecated pasteText
await Clipboard.paste("text");Storage
The methods and interfaces related to the Storage can now be found under the LocalStorage namespace.
import { LocalStorage } from "@raycast/api";
// deprecated allLocalStorageItems
const items = await LocalStorage.allItems();
// deprecated getLocalStorageItem
const item = await LocalStorage.getItem("key");
// deprecated setLocalStorageItem
await LocalStorage.setItem("key", "value");
// deprecated removeLocalStorageItem
await LocalStorage.removeItem("key");
// deprecated clearLocalStorage
await LocalStorage.clear();
// we didn't expect you to use the Storage interfaces
// but they are now also under LocalStorage
// deprecated LocalStorageValue
LocalStorage.Value;
// deprecated LocalStorageValues
LocalStorage.Values;Feedback
The main changes to the Feedback methods are related to the Toast:
showToast now accepts a Toast.Options object as an argument and its style will default to Toast.Style.Success.
The interfaces and enumerations of both the Toast and Alert can now be found under their respective namespaces.
Keyboard
The interfaces related to the Keyboard can now be found under the Keyboard namespace.
Preferences
We are deprecating the preferences constant because we found it to be error-prone. Instead, you should always use getPreferenceValues() which allows for a type-safe access with fallback to the defaults.
User Interface
There are two important changes related to the React components:
ActionPanel.Itemhas been renamed toAction. All the specific actions are now nested underAction. This will make it easier to introduce and teach the concept of Action.All the props interfaces are now accessible under their respective components
Color
The interfaces related to the Color can now be found under the Color namespace.
Image
The interfaces and enumerations related to the Image can now be found under the Image namespace. Icon is still a top-level export.
Misc
We are deprecating the
randomIdutility. It wasn't related to Raycast. Instead, you can use thenanoiddependency.We are deprecating the
useIdhook. It was used internally but there shouldn't be a use-case for it in your extensions.We are deprecating the
useActionPanelhook. Use theActionPanelcomponent instead.We are deprecating the
rendermethod. You shouldexport defaultyour root component instead.
Last updated

