DocsFig

Fig namespace

import { Fig } from '@withfig/api-bindings'

modifiersFromJSON

Declaration

export function modifiersFromJSON(object: any): Modifiers;

modifiersToJSON

Declaration

export function modifiersToJSON(object: Modifiers): string;

onboardingActionFromJSON

Declaration

export function onboardingActionFromJSON(object: any): OnboardingAction;

onboardingActionToJSON

Declaration

export function onboardingActionToJSON(object: OnboardingAction): string;

focusActionFromJSON

Declaration

export function focusActionFromJSON(object: any): FocusAction;

focusActionToJSON

Declaration

export function focusActionToJSON(object: FocusAction): string;

actionAvailabilityFromJSON

Declaration

export function actionAvailabilityFromJSON(object: any): ActionAvailability;

actionAvailabilityToJSON

Declaration

export function actionAvailabilityToJSON(object: ActionAvailability): string;

notificationTypeFromJSON

Declaration

export function notificationTypeFromJSON(object: any): NotificationType;

notificationTypeToJSON

Declaration

export function notificationTypeToJSON(object: NotificationType): string;

protobufPackage

Declaration

export const protobufPackage = "fig";

Modifiers

Declaration

export enum Modifiers {
  CONTROL = 0,
  OPTION = 1,
  COMMAND = 2,
  SHIFT = 3,
  FUNCTION = 4,
  NUMPAD = 5,
  UNRECOGNIZED = -1
}

OnboardingAction

Declaration

export enum OnboardingAction {
  INSTALLATION_SCRIPT = 0,
  PROMPT_FOR_ACCESSIBILITY_PERMISSION = 1,
  LAUNCH_SHELL_ONBOARDING = 3,
  UNINSTALL = 4,
  UNRECOGNIZED = -1
}

FocusAction

Declaration

export enum FocusAction {
  TAKE_FOCUS = 0,
  RETURN_FOCUS = 1,
  UNRECOGNIZED = -1
}

ActionAvailability

Declaration

export enum ActionAvailability {
  ALWAYS = 0,
  /** WHEN_FOCUSED - the action can only be performed when the app has keyboard focus */
  WHEN_FOCUSED = 1,
  /** WHEN_VISIBLE - the action can only be performed when the app is visible */
  WHEN_VISIBLE = 2,
  /** WHEN_HIDDEN - the action can only be performed when the app is hidden */
  WHEN_HIDDEN = 3,
  UNRECOGNIZED = -1
}

NotificationType

Declaration

export enum NotificationType {
  ALL = 0,
  NOTIFY_ON_EDITBUFFFER_CHANGE = 1,
  NOTIFY_ON_SETTINGS_CHANGE = 2,
  NOTIFY_ON_PROMPT = 3,
  NOTIFY_ON_LOCATION_CHANGE = 4,
  NOTIFY_ON_PROCESS_CHANGED = 5,
  NOTIFY_ON_KEYBINDING_PRESSED = 6,
  NOTIFY_ON_FOCUS_CHANGED = 7,
  NOTIFY_ON_HISTORY_UPDATED = 8,
  UNRECOGNIZED = -1
}

ClientOriginatedMessage

Declaration

export interface ClientOriginatedMessage {
  id?: number | undefined;
  submessage?:
    | {
        $case: "positionWindowRequest";
        positionWindowRequest: PositionWindowRequest;
      }
    | {
        $case: "pseudoterminalExecuteRequest";
        pseudoterminalExecuteRequest: PseudoterminalExecuteRequest;
      }
    | {
        $case: "pseudoterminalWriteRequest";
        pseudoterminalWriteRequest: PseudoterminalWriteRequest;
      }
    | { $case: "readFileRequest"; readFileRequest: ReadFileRequest }
    | { $case: "writeFileRequest"; writeFileRequest: WriteFileRequest }
    | {
        $case: "contentsOfDirectoryRequest";
        contentsOfDirectoryRequest: ContentsOfDirectoryRequest;
      }
    | { $case: "notificationRequest"; notificationRequest: NotificationRequest }
    | {
        $case: "getSettingsPropertyRequest";
        getSettingsPropertyRequest: GetSettingsPropertyRequest;
      }
    | {
        $case: "updateSettingsPropertyRequest";
        updateSettingsPropertyRequest: UpdateSettingsPropertyRequest;
      }
    | { $case: "insertTextRequest"; insertTextRequest: InsertTextRequest }
    | {
        $case: "updateApplicationPropertiesRequest";
        updateApplicationPropertiesRequest: UpdateApplicationPropertiesRequest;
      }
    | {
        $case: "destinationOfSymbolicLinkRequest";
        destinationOfSymbolicLinkRequest: DestinationOfSymbolicLinkRequest;
      }
    | {
        $case: "getDefaultsPropertyRequest";
        getDefaultsPropertyRequest: GetDefaultsPropertyRequest;
      }
    | {
        $case: "updateDefaultsPropertyRequest";
        updateDefaultsPropertyRequest: UpdateDefaultsPropertyRequest;
      }
    | {
        $case: "telemetryAliasRequest";
        telemetryAliasRequest: TelemetryAliasRequest;
      }
    | {
        $case: "telemetryIdentifyRequest";
        telemetryIdentifyRequest: TelemetryIdentifyRequest;
      }
    | {
        $case: "telemetryTrackRequest";
        telemetryTrackRequest: TelemetryTrackRequest;
      }
    | { $case: "onboardingRequest"; onboardingRequest: OnboardingRequest }
    | { $case: "windowFocusRequest"; windowFocusRequest: WindowFocusRequest }
    | {
        $case: "openInExternalApplicationRequest";
        openInExternalApplicationRequest: OpenInExternalApplicationRequest;
      }
    | {
        $case: "getConfigPropertyRequest";
        getConfigPropertyRequest: GetConfigPropertyRequest;
      }
    | {
        $case: "updateConfigPropertyRequest";
        updateConfigPropertyRequest: UpdateConfigPropertyRequest;
      }
    | {
        $case: "pseudoterminalRestartRequest";
        pseudoterminalRestartRequest: PseudoterminalRestartRequest;
      }
    | {
        $case: "terminalSessionInfoRequest";
        terminalSessionInfoRequest: TerminalSessionInfoRequest;
      };
}

ServerOriginatedMessage

Declaration

export interface ServerOriginatedMessage {
  id?: number | undefined;
  submessage?:
    | { $case: "error"; error: string }
    | { $case: "success"; success: boolean }
    | {
        $case: "positionWindowResponse";
        positionWindowResponse: PositionWindowResponse;
      }
    | {
        $case: "pseudoterminalExecuteResponse";
        pseudoterminalExecuteResponse: PseudoterminalExecuteResponse;
      }
    | { $case: "readFileResponse"; readFileResponse: ReadFileResponse }
    | {
        $case: "contentsOfDirectoryResponse";
        contentsOfDirectoryResponse: ContentsOfDirectoryResponse;
      }
    | {
        $case: "getSettingsPropertyResponse";
        getSettingsPropertyResponse: GetSettingsPropertyResponse;
      }
    | {
        $case: "destinationOfSymbolicLinkResponse";
        destinationOfSymbolicLinkResponse: DestinationOfSymbolicLinkResponse;
      }
    | {
        $case: "getDefaultsPropertyResponse";
        getDefaultsPropertyResponse: GetDefaultsPropertyResponse;
      }
    | {
        $case: "getConfigPropertyResponse";
        getConfigPropertyResponse: GetConfigPropertyResponse;
      }
    | {
        $case: "terminalSessionInfoResponse";
        terminalSessionInfoResponse: TerminalSessionInfoResponse;
      }
    | { $case: "notification"; notification: Notification };
}

Point

Declaration

export interface Point {
  x: number;
  y: number;
}

Size

Declaration

export interface Size {
  width: number;
  height: number;
}

Frame

Declaration

export interface Frame {
  origin: Point | undefined;
  size: Size | undefined;
}

EnvironmentVariable

Declaration

export interface EnvironmentVariable {
  key: string;
  value?: string | undefined;
}

Process

Declaration

export interface Process {
  pid?: number | undefined;
  executable?: string | undefined;
  directory?: string | undefined;
  env: EnvironmentVariable[];
}

FilePath

Declaration

export interface FilePath {
  path?: string | undefined;
  relativeTo?: string | undefined;
  expandTildeInPath?: boolean | undefined;
}

KeyEvent

Declaration

export interface KeyEvent {
  appleKeyCode?: number | undefined;
  characters?: string | undefined;
  charactersIgnoringModifiers?: string | undefined;
  modifiers: Modifiers[];
  isRepeat?: boolean | undefined;
}

Screen

Declaration

export interface Screen {
  frame?: Frame | undefined;
}

Session

Declaration

export interface Session {
  sessionId?: string | undefined;
  frontmostProcess?: Process | undefined;
  env: EnvironmentVariable[];
}

Application

Declaration

export interface Application {
  bundleIdentifier?: string | undefined;
  name?: string | undefined;
}

Window

Declaration

export interface Window {
  windowId?: string | undefined;
  frame?: Frame | undefined;
  currentSession?: Session | undefined;
  app?: Application | undefined;
  currentScreen?: Screen | undefined;
}

TextUpdate

Declaration

export interface TextUpdate {
  insertion?: string | undefined;
  deletion?: number | undefined;
  offset?: number | undefined;
  immediate?: boolean | undefined;
}

InsertTextRequest

Declaration

export interface InsertTextRequest {
  type?:
    | { $case: "text"; text: string }
    | { $case: "update"; update: TextUpdate };
}

PseudoterminalWriteRequest

Declaration

export interface PseudoterminalWriteRequest {
  input?:
    | { $case: "text"; text: string }
    | { $case: "octal"; octal: Uint8Array };
}

PseudoterminalExecuteRequest

Declaration

export interface PseudoterminalExecuteRequest {
  command: string;
  workingDirectory?: string | undefined;
  backgroundJob?: boolean | undefined;
  isPipelined?: boolean | undefined;
  env: EnvironmentVariable[];
}

PseudoterminalExecuteResponse

Declaration

export interface PseudoterminalExecuteResponse {
  stdout: string;
  stderr?: string | undefined;
  exitCode?: number | undefined;
}

PseudoterminalRestartRequest

Declaration

export interface PseudoterminalRestartRequest {}

PositionWindowRequest

Declaration

export interface PositionWindowRequest {
  anchor: Point | undefined;
  size: Size | undefined;
  dryrun?: boolean | undefined;
}

PositionWindowResponse

Declaration

export interface PositionWindowResponse {
  isAbove?: boolean | undefined;
  isClipped?: boolean | undefined;
}

ReadFileRequest

Declaration

export interface ReadFileRequest {
  path?: FilePath | undefined;
  isBinaryFile?: boolean | undefined;
}

ReadFileResponse

Declaration

export interface ReadFileResponse {
  type?: { $case: "data"; data: Uint8Array } | { $case: "text"; text: string };
}

WriteFileRequest

Declaration

export interface WriteFileRequest {
  path?: FilePath | undefined;
  data?:
    | { $case: "text"; text: string }
    | { $case: "binary"; binary: Uint8Array };
}

ContentsOfDirectoryRequest

Declaration

export interface ContentsOfDirectoryRequest {
  directory?: FilePath | undefined;
}

ContentsOfDirectoryResponse

Declaration

export interface ContentsOfDirectoryResponse {
  fileNames: string[];
}

DestinationOfSymbolicLinkRequest

Declaration

export interface DestinationOfSymbolicLinkRequest {
  path?: FilePath | undefined;
}

DestinationOfSymbolicLinkResponse

Declaration

export interface DestinationOfSymbolicLinkResponse {
  destination?: FilePath | undefined;
}

DefaultsValue

Declaration

export interface DefaultsValue {
  type?:
    | { $case: "null"; null: boolean }
    | { $case: "boolean"; boolean: boolean }
    | { $case: "string"; string: string }
    | { $case: "integer"; integer: number };
}

GetDefaultsPropertyRequest

Declaration

export interface GetDefaultsPropertyRequest {
  key?: string | undefined;
}

GetDefaultsPropertyResponse

Declaration

export interface GetDefaultsPropertyResponse {
  key?: string | undefined;
  value?: DefaultsValue | undefined;
}

UpdateDefaultsPropertyRequest

Declaration

export interface UpdateDefaultsPropertyRequest {
  key?: string | undefined;
  value?: DefaultsValue | undefined;
}

GetConfigPropertyRequest

Declaration

export interface GetConfigPropertyRequest {
  key?: string | undefined;
}

GetConfigPropertyResponse

Declaration

export interface GetConfigPropertyResponse {
  value?: string | undefined;
}

UpdateConfigPropertyRequest

Declaration

export interface UpdateConfigPropertyRequest {
  key?: string | undefined;
  value?: string | undefined;
}

GetSettingsPropertyRequest

Declaration

export interface GetSettingsPropertyRequest {
  key?: string | undefined;
}

GetSettingsPropertyResponse

Declaration

export interface GetSettingsPropertyResponse {
  jsonBlob?: string | undefined;
  isDefault?: boolean | undefined;
}

UpdateSettingsPropertyRequest

Declaration

export interface UpdateSettingsPropertyRequest {
  key?: string | undefined;
  value?: string | undefined;
}

TelemetryProperty

Declaration

export interface TelemetryProperty {
  key: string;
  value: string;
}

TelemetryAliasRequest

Declaration

export interface TelemetryAliasRequest {
  userId?: string | undefined;
}

TelemetryTrackRequest

Declaration

export interface TelemetryTrackRequest {
  event?: string | undefined;
  properties: TelemetryProperty[];
}

TelemetryIdentifyRequest

Declaration

export interface TelemetryIdentifyRequest {
  traits: TelemetryProperty[];
}

OnboardingRequest

Declaration

export interface OnboardingRequest {
  action: OnboardingAction;
}

WindowFocusRequest

Declaration

export interface WindowFocusRequest {
  type?: FocusAction | undefined;
}

OpenInExternalApplicationRequest

Declaration

export interface OpenInExternalApplicationRequest {
  url?: string | undefined;
}

Action

Declaration

export interface Action {
  /** unique identifier for the action; not user facing. */
  identifier?: string | undefined;
  /** name of action, will appear in user interfaces. */
  name?: string | undefined;
  /** a quick summary of what the action will do */
  description?: string | undefined;
  category?: string | undefined;
  /** when can this action be performed */
  availability?: ActionAvailability | undefined;
}

ActionList

Declaration

export interface ActionList {
  actions: Action[];
}

UpdateApplicationPropertiesRequest

Declaration

export interface UpdateApplicationPropertiesRequest {
  interceptBoundKeystrokes?: boolean | undefined;
  interceptGlobalKeystrokes?: boolean | undefined;
  actionList?: ActionList | undefined;
}

TerminalSessionInfoRequest

Declaration

export interface TerminalSessionInfoRequest {
  terminalSessionId: string;
}

TerminalSessionInfoResponse

Declaration

export interface TerminalSessionInfoResponse {
  context?: ShellContext | undefined;
  buffer?: string | undefined;
  cursor?: number | undefined;
}

NotificationRequest

Declaration

export interface NotificationRequest {
  subscribe?: boolean | undefined;
  type?: NotificationType | undefined;
}

Notification

Declaration

export interface Notification {
  type?:
    | {
        $case: "editBufferNotification";
        editBufferNotification: EditBufferChangedNotification;
      }
    | {
        $case: "settingsChangedNotification";
        settingsChangedNotification: SettingsChangedNotification;
      }
    | {
        $case: "shellPromptReturnedNotification";
        shellPromptReturnedNotification: ShellPromptReturnedNotification;
      }
    | {
        $case: "locationChangedNotification";
        locationChangedNotification: LocationChangedNotification;
      }
    | {
        $case: "processChangeNotification";
        processChangeNotification: ProcessChangedNotification;
      }
    | {
        $case: "keybindingPressedNotification";
        keybindingPressedNotification: KeybindingPressedNotification;
      }
    | {
        $case: "windowFocusChangedNotification";
        windowFocusChangedNotification: WindowFocusChangedNotification;
      }
    | {
        $case: "historyUpdatedNotification";
        historyUpdatedNotification: HistoryUpdatedNotification;
      };
}

EditBufferChangedNotification

Declaration

export interface EditBufferChangedNotification {
  sessionId?: string | undefined;
  cursor?: number | undefined;
  buffer?: string | undefined;
  context?: ShellContext | undefined;
}

SettingsChangedNotification

Declaration

export interface SettingsChangedNotification {
  jsonBlob?: string | undefined;
}

ShellPromptReturnedNotification

Declaration

export interface ShellPromptReturnedNotification {
  sessionId?: string | undefined;
  shell?: Process | undefined;
}

LocationChangedNotification

Declaration

export interface LocationChangedNotification {
  sessionId?: string | undefined;
  hostName?: string | undefined;
  userName?: string | undefined;
  directory?: string | undefined;
}

ProcessChangedNotification

Declaration

export interface ProcessChangedNotification {
  sessionId?: string | undefined;
  newProcess?: Process | undefined;
}

KeybindingPressedNotification

Declaration

export interface KeybindingPressedNotification {
  keypress?: KeyEvent | undefined;
  action?: string | undefined;
}

WindowFocusChangedNotification

Declaration

export interface WindowFocusChangedNotification {
  window?: Window | undefined;
}

HistoryUpdatedNotification

Declaration

export interface HistoryUpdatedNotification {
  command?: string | undefined;
  /** the name of the process */
  processName?: string | undefined;
  /** the directory where the user ran the command */
  currentWorkingDirectory?: string | undefined;
  /** the value of $TERM_SESSION_ID */
  sessionId?: string | undefined;
  hostname?: string | undefined;
  /** the exit code of the command */
  exitCode?: number | undefined;
}

Constants

/ Constants Can be found under fig.constants. Certain legacy constants are included at the top-level for backwards compatibility.

Declaration

export interface Constants {
  /** the current version of Fig */
  version?: string | undefined;
  /** the current build of Fig */
  build?: string | undefined;
  /** the path to the figcli executable */
  cli?: string | undefined;
  /** the filepath of the macOS bundle */
  bundlePath?: string | undefined;
  /** the remote URL where apps are loaded from */
  remote?: string | undefined;
  /** the user's home directory */
  home?: string | undefined;
  /** the user's name (equivalent to running `whoami`) */
  user?: string | undefined;
  /** the default macOS $PATH */
  defaultPath?: string | undefined;
  jsonMessageRecieved?: string | undefined;
  jsonMessageHandler?: string | undefined;
  protoMessageRecieved?: string | undefined;
  protoMessageHandler?: string | undefined;
  /** a comma-separated list of all themes */
  themes?: string | undefined;
}

DeepPartial

Declaration

export type DeepPartial<T> = T extends Builtin
  ? T
  : T extends Array<infer U>
  ? Array<DeepPartial<U>>
  : T extends ReadonlyArray<infer U>
  ? ReadonlyArray<DeepPartial<U>>
  : T extends { $case: string }
  ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & {
      $case: T["$case"];
    }
  : T extends {}
  ? { [K in keyof T]?: DeepPartial<T[K]> }
  : Partial<T>;

On this page