I am working with a specific type called IPermissionAction which includes options like 'update', 'delete', 'create', and 'read'.
type IPermissionAction = 'update' | 'delete' | 'create' | 'read'
When trying to create an object that conforms to this type, such as:
const object = {
subject: 'correspondence',
action: 'update' as keyof IPermissionAction
}
I encountered an error message stating:
Argument of type 'string | number | unique symbol' is not assignable to parameter of type 'IPermissionAction'.
Type 'string' is not assignable to type 'IPermissionAction'.ts(2345)
I attempted to use keyof but it didn't resolve the issue.