/** * External dependencies */ import { make } from 'ts-brand'; import type { AuthorId, PostCapability, PostTypeName, PremiumItemType, RoleId, } from '@nelio-content/types'; export type State = { readonly id: AuthorId; readonly role: RoleId; readonly pluginPermission: 'manage' | 'use'; readonly postTypeCapabilities: Record< PostTypeName, ReadonlyArray< PostCapability > >; readonly socialEditorPermission: 'none' | 'post-type' | 'all'; readonly taskEditorPermission: 'none' | 'post-type' | 'all'; readonly premiumEditorPermissionsByType: Partial< Record< PremiumItemType, 'none' | 'post-type' | 'all' > >; }; export const INIT: State = { id: make< AuthorId >()( 0 ), role: 'subscriber' as RoleId, pluginPermission: 'use', postTypeCapabilities: {}, socialEditorPermission: 'none', taskEditorPermission: 'none', premiumEditorPermissionsByType: {}, };