export type GetDataFunction = () => Promise; export type ListDataFunction = () => Promise; export type LookupDataFunction = (id: ID) => Promise; export type ActionFunction = (id: ID, input: I) => Promise; export type IdTranslationFunction = (idOrIndex: ID | string, listFunction: ListDataFunction) => Promise; export type IdRetrievalFunction = (fieldInfo: Sorting, list: L[], promptMessage?: string) => Promise; /** * This interface is used when a list is presented to the user, especially when they will have the * opportunity to select an item from the list. * * The primary (but not only) example of this the list/get versions of commands. Consider the * simple `locations` command. When specified without an id or index, it needs to present the * results in a consistent order. If the user specifies an index into that list when querying * a single location, the sort key specified here is used again to ensure the same ordering. */ export type Sorting = { /** * The primary key used to uniquely identify this object. */ primaryKeyName: Extract; /** * The field you want to sort by when presenting a list of items. */ sortKeyName?: Extract; }; /** * This interface is used in configurations to help describe a named item. * * If you're writing code that uses this interface, use `itemName` or `pluralItemName` from * command-util to translate a `Naming` instance to a name. */ export type Naming = { /** * The singular name of your item, using lowercase letters and spaces to separate words. */ itemName?: string; /** * You only need to specify the plural version of your name if adding a simple "s" is incorrect. */ pluralItemName?: string; }; //# sourceMappingURL=io-defs.d.ts.map