Skip to content

Commit

Permalink
feat(types): add generateSpecCacheKey to Fig.Subcommand (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
grant0417 authored May 8, 2024
1 parent 1f5845b commit a3e43f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,13 @@ declare namespace Fig {
*/
generateSpec?: (tokens: string[], executeCommand: ExecuteCommandFunction) => Promise<Spec>;

/**
* Generating a spec can be expensive, but due to current guarantees they are not cached.
* This function generates a cache key which is used to cache the result of generateSpec.
* If `undefined` is returned, the cache will not be used.
*/
generateSpecCacheKey?: Function<{ tokens: string[] }, string | undefined> | string;

/**
* Configure how the autocomplete engine will map the raw tokens to a given completion spec.
*
Expand Down

0 comments on commit a3e43f3

Please sign in to comment.