Assert a certain type for a literal. This can be used to correctly type parts of an object in TypeScript.
{[ActionId.MyAction]: literal<CompanionActionDefinition>({ name: 'My Action', // ...})} Copy
{[ActionId.MyAction]: literal<CompanionActionDefinition>({ name: 'My Action', // ...})}
instead of this
{ [ActionId.MyAction]: { name: 'My Action', // ... }} Copy
{ [ActionId.MyAction]: { name: 'My Action', // ... }}
Assert a certain type for a literal. This can be used to correctly type parts of an object in TypeScript.
Example
instead of this