@withfig/autocomplete-types
Advanced tools
+124
-42
@@ -27,3 +27,2 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
| * `ls` used ["filepaths", "folders"]. Why both? Because if I `ls` a directory, we want to enable a user to autoexecute on this directory. If we just did "filepaths" they couldn't autoexecute. | ||
| * | ||
| */ | ||
@@ -51,3 +50,2 @@ type Template = TemplateStrings | TemplateStrings[]; | ||
| /** | ||
| * | ||
| * The SpecLocation object defines well... the location of the completion spec we want to load. | ||
@@ -133,3 +131,2 @@ * Specs can be "global" (ie hosted by Fig's cloud) or "local" (ie stored on your local machine) | ||
| * `v26` | ||
| * | ||
| */ | ||
@@ -250,2 +247,67 @@ type GetVersionCommand = (executeShellCommand: ExecuteShellCommandFunction) => Promise<string>; | ||
| /** | ||
| * @excluded | ||
| */ | ||
| type ExecFunctionOptions = ( | ||
| | { | ||
| /** | ||
| * The command to execute, this will be executed in bash like a normal shell command. | ||
| * @example | ||
| * `echo hello world` | ||
| * @example | ||
| * `ls` | ||
| */ | ||
| command: string; | ||
| } | ||
| | { | ||
| /** | ||
| * This will execute the command without a shell, so you can use this to execute a binary. | ||
| * @example | ||
| * ["ls", "-a"] | ||
| */ | ||
| args: string[]; | ||
| } | ||
| ) & { | ||
| /** | ||
| * The directory in which to execute the command, if not specified, the current working directory will be used. | ||
| */ | ||
| cwd?: string; | ||
| /** | ||
| * Whether to clear the environment variables or not before executing the command. | ||
| * @default false | ||
| */ | ||
| clearEnv?: boolean; | ||
| /** | ||
| * The environment variables to set before executing the command. | ||
| * @example | ||
| * { PATH: "/usr/bin", HELLO: "world", FOO: null } | ||
| */ | ||
| env?: Record<string, string | null>; | ||
| }; | ||
| /** | ||
| * The result of the `ExecuteShellCommandFunction` | ||
| * | ||
| * @excluded | ||
| */ | ||
| type ExecFunctionResult = { | ||
| /** | ||
| * The output of the command on stdout. | ||
| */ | ||
| stdout: string; | ||
| /** | ||
| * The output of the command on stderr. | ||
| */ | ||
| stderr: string; | ||
| /** | ||
| * The exit code of the command. | ||
| */ | ||
| exitCode: number; | ||
| }; | ||
| /** | ||
| * @excluded | ||
| */ | ||
| type ExecFunction = (options: ExecFunctionOptions) => Promise<ExecFunctionResult>; | ||
| type CacheMaxAge = { | ||
@@ -371,3 +433,2 @@ strategy: "max-age"; | ||
| * `fig://icon?type=file` | ||
| * | ||
| */ | ||
@@ -422,3 +483,2 @@ icon?: string; | ||
| /** | ||
| * | ||
| * Specifies whether a suggestion is deprecated. | ||
@@ -435,2 +495,19 @@ * @remarks | ||
| deprecated?: boolean | Omit<BaseSuggestion, "deprecated">; | ||
| /** | ||
| * Specifies which component to use to render the preview window. | ||
| * | ||
| * @remarks This should be the path within the `src` directory to the component without the extension. | ||
| * | ||
| * @example 'ls/filepathPreview' | ||
| */ | ||
| previewComponent?: string; | ||
| /** | ||
| * This is a way to pass data to the Autocomplete Engine that is not formalized in the spec, do not use this in specs as it may change at any time | ||
| * | ||
| * @excluded | ||
| * @ignore | ||
| */ | ||
| _internal?: Record<string, unknown>; | ||
| } | ||
@@ -454,3 +531,2 @@ | ||
| * If a user types git `c`, any Suggestion objects with a name prop that has a value starting with "c" will match. | ||
| * | ||
| */ | ||
@@ -484,3 +560,2 @@ name?: SingleOrArray<string>; | ||
| * | ||
| * | ||
| * @example | ||
@@ -521,3 +596,2 @@ * For `git checkout`, the subcommand `checkout` would have `name: "checkout"` | ||
| * An array of `Arg` objects representing the various parameters or "arguments" that can be passed to this subcommand. | ||
| * | ||
| */ | ||
@@ -560,3 +634,2 @@ args?: SingleOrArray<Arg>; | ||
| * You can use this field to suggest common workflows. | ||
| * | ||
| */ | ||
@@ -669,3 +742,2 @@ additionalSuggestions?: (string | Suggestion)[]; | ||
| * | ||
| * | ||
| * @example | ||
@@ -694,3 +766,2 @@ * For `git commit -m` in the, message option nested beneath `commit` would have `name: ["-m", "--message"]` | ||
| /** | ||
| * | ||
| * Signals whether an option is persistent, meaning that it will still be available | ||
@@ -710,3 +781,2 @@ * as an option for all child subcommands. | ||
| * as a valid as we are passing the `--help` option to all `git` subcommands. | ||
| * | ||
| */ | ||
@@ -720,7 +790,5 @@ isPersistent?: boolean; | ||
| * The `-m` option of `git commit` is required | ||
| * | ||
| */ | ||
| isRequired?: boolean; | ||
| /** | ||
| * | ||
| * Signals whether an equals sign is required to pass an argument to an option (e.g. `git commit --message="msg"`) | ||
@@ -733,7 +801,5 @@ * @defaultValue false (does NOT require an equal) | ||
| * @deprecated use `requiresSeparator` instead | ||
| * | ||
| */ | ||
| requiresEquals?: boolean; | ||
| /** | ||
| * | ||
| * Signals whether one of the separators specified in parserDirectives is required to pass an argument to an option (e.g. `git commit --message[separator]"msg"`) | ||
@@ -751,3 +817,2 @@ * If set to true this will automatically insert an equal after the option name. | ||
| /** | ||
| * | ||
| * Signals whether an option can be passed multiple times. | ||
@@ -784,7 +849,5 @@ * | ||
| * and will treat this as an argument to `ssh`. | ||
| * | ||
| */ | ||
| isRepeatable?: boolean | number; | ||
| /** | ||
| * | ||
| * Signals whether an option is mutually exclusive with other options (ie if the user has this option, Fig should not show the options specified). | ||
@@ -799,8 +862,5 @@ * @defaultValue false | ||
| * If we were defining the exclusive prop of the "-a" option, then we would have `exclusive: ["--interactive", "--patch"]` | ||
| * | ||
| */ | ||
| exclusiveOn?: string[]; | ||
| /** | ||
| * | ||
| * | ||
| * Signals whether an option depends on other options (ie if the user has this option, Fig should only show these options until they are all inserted). | ||
@@ -816,3 +876,2 @@ * | ||
| * In this case, `--extension` dependsOn `--project` | ||
| * | ||
| */ | ||
@@ -885,7 +944,5 @@ dependsOn?: string[]; | ||
| * `ls` used ["filepaths", "folders"]. Why both? Because if I `ls` a directory, we want to enable a user to autoexecute on this directory. If we just did "filepaths" they couldn't autoexecute. | ||
| * | ||
| */ | ||
| template?: Template; | ||
| /** | ||
| * | ||
| * Generators let you dynamically generate suggestions for arguments by running shell commands on a user's device. | ||
@@ -951,3 +1008,2 @@ * | ||
| * | ||
| * | ||
| * @defaultValue true | ||
@@ -973,3 +1029,2 @@ * | ||
| * variadic arguments haven't started yet | ||
| * | ||
| */ | ||
@@ -1020,4 +1075,9 @@ optionsCanBreakVariadicArg?: boolean; | ||
| * This will debounce every keystroke event for this particular arg. | ||
| * | ||
| * If `true` the debounce time will be 200ms. | ||
| * | ||
| * If a number, the debounce time will be that number of milliseconds. | ||
| * | ||
| * @remarks | ||
| * If there are no keystroke events after 100ms, Fig will execute all the generators in this arg and return the suggestions. | ||
| * If set and there are no keystroke events after the period of time, Fig will execute all the generators in this arg and return the suggestions. | ||
| * | ||
@@ -1027,3 +1087,3 @@ * @example | ||
| */ | ||
| debounce?: boolean; | ||
| debounce?: boolean | number; | ||
| /** | ||
@@ -1034,3 +1094,2 @@ * The default value for an optional argument. | ||
| * Note: This is currently not used anywhere in Fig's autocomplete popup, but will be soon. | ||
| * | ||
| */ | ||
@@ -1045,3 +1104,2 @@ default?: string; | ||
| * 2. `isScript` (See [Arg Object](https://fig.io/docs/reference/arg#isscript)) | ||
| * | ||
| */ | ||
@@ -1078,3 +1136,2 @@ loadSpec?: LoadSpec; | ||
| * The generator object is used to generate suggestions for an arg object. To do this, it runs a defined shell command on the user's device, gets the output, and returns a list of Suggestion objects. | ||
| * | ||
| */ | ||
@@ -1096,7 +1153,5 @@ interface Generator { | ||
| * `ls` uses ["filepaths", "folders"]. Why both? Because if I `ls` a directory, we want to enable a user to autoexecute on this directory. If we just did "filepaths" they couldn't autoexecute. | ||
| * | ||
| */ | ||
| template?: Template; | ||
| /** | ||
| * | ||
| * A function to filter and modify suggestions returned by a template | ||
@@ -1112,3 +1167,2 @@ * | ||
| /** | ||
| * | ||
| * The script / shell command you wish to run on the user's device at their shell session's current working directory. | ||
@@ -1131,3 +1185,2 @@ * @remarks | ||
| /** | ||
| * | ||
| * Process the string output from the `script` prop and return a list of suggestions | ||
@@ -1138,3 +1191,2 @@ * | ||
| * @returns An array of `Suggestion` objects. | ||
| * | ||
| */ | ||
@@ -1153,3 +1205,2 @@ postProcess?: (out: string, tokens: string[]) => Suggestion[]; | ||
| /** | ||
| * | ||
| * A function run on every keystroke that determines whether Fig should invalidate its cached list of suggestions and instead regenerate its list of suggestions. | ||
@@ -1174,3 +1225,2 @@ * | ||
| * | ||
| * | ||
| * @param newToken - The new token that was just typed by the user e.g. "desktop/"" | ||
@@ -1213,3 +1263,2 @@ * @param oldToken - The old token that was there before e.g. "desktop" | ||
| * if the user types cd `~/desktop/a`, the list of suggestions will be all the folders on the user's desktop. We want to filter over these folders with the query term `"a"` not `~/desktop/a` | ||
| * | ||
| */ | ||
@@ -1250,4 +1299,38 @@ getQueryTerm?: StringOrFunction<string, string>; | ||
| ) => Promise<Suggestion[]>; | ||
| /** | ||
| * | ||
| * Not yet supported, early work on new custom generator API | ||
| * @internal | ||
| * @excluded | ||
| */ | ||
| func?: (options: { | ||
| tokens: string[]; | ||
| exec: ExecFunction; | ||
| executeShellCommand: ExecuteShellCommandFunction; | ||
| shellContext: ShellContext; | ||
| }) => Promise<Suggestion[]>; | ||
| /** | ||
| * Not yet supported, early work on new custom generator API | ||
| * @excluded | ||
| */ | ||
| stream?: (options: { | ||
| tokens: string[]; | ||
| exec: ExecFunction; | ||
| executeShellCommand: ExecuteShellCommandFunction; | ||
| shellContext: ShellContext; | ||
| }) => AsyncGenerator< | ||
| (Suggestion & { | ||
| /** | ||
| * If you yield a suggestion with an id, it will upsert the suggestion with that id | ||
| */ | ||
| id?: string; | ||
| /** | ||
| * If marked as incomplete, Fig will show a loading indicator while the suggestion is being generated and it will not be able to be used | ||
| */ | ||
| incomplete?: boolean; | ||
| })[] | ||
| >; | ||
| /** | ||
| * Cache the response of generators for a specific period time and optionally by directory the commands were executed in. | ||
@@ -1264,3 +1347,2 @@ * | ||
| * The kubernetes spec makes use of this. | ||
| * | ||
| */ | ||
@@ -1267,0 +1349,0 @@ cache?: Cache; |
+1
-1
| { | ||
| "name": "@withfig/autocomplete-types", | ||
| "description": "Typings for fig autocomplete specs and other tools", | ||
| "version": "1.27.0", | ||
| "version": "1.28.0", | ||
| "author": "The Fig Team", | ||
@@ -6,0 +6,0 @@ "types": "index.d.ts", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
65625
4.62%1263
6.22%