MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / computedDef

Function computedDef

src/lib/item-input/misc.ts:131–138  ·  view source on GitHub ↗
(compute: (context?: unknown[]) => T)

Source from the content-addressed store, hash-verified

129export const undefinedDef = staticDef(undefined)
130
131export const computedDef = <T>(compute: (context?: unknown[]) => T): InputDefinition<T> => {
132 const buildFromUserInput = async (context?: unknown[]): Promise<T> => compute(context)
133 const summarizeForEdit = (): Uneditable => uneditable
134 // TODO: consider how we might calling this if anything in the context prior to it is edited
135 const updateFromUserInput = async (_original: T, context?: unknown[]): Promise<T> => compute(context)
136 // TODO: implement updateIfNeeded
137 return { name: 'unused', buildFromUserInput, summarizeForEdit, updateFromUserInput }
138}
139
140export type ListSelectionDefOptions<T> = {
141 /**

Callers 2

misc.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected