const options = [
{ identifier: "prefix", type: "string", defaultValue: ">" },
{ identifier: "loud", type: "boolean", defaultValue: false },
] as const;
// { readonly prefix: string; readonly loud: boolean }
type MyOptions = InferOptions<typeof options>;
defineExtension<MyOptions>({ options, action: (input, options) => { ... } });
The type of the
optionsobject, derived from an options array. Pass it as the type parameter of defineExtension so that action functions and the population function see the real option identifiers and value types, instead of the generic Options.The array must be declared
as const, so that the identifiers and types are literal.headingandpasswordoptions carry no value and are omitted.