Changeset View
Changeset View
Standalone View
Standalone View
lib/types/thread-types.js
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | threadType === 3 || | ||||
threadType === 9 || | threadType === 9 || | ||||
threadType === 10 || | threadType === 10 || | ||||
threadType === 11 || | threadType === 11 || | ||||
threadType === 12, | threadType === 12, | ||||
'number is not ThreadType enum', | 'number is not ThreadType enum', | ||||
); | ); | ||||
return threadType; | return threadType; | ||||
} | } | ||||
export const communityThreadTypes: Array<number> = Object.freeze([ | export const communityThreadTypes: $ReadOnlyArray<number> = Object.freeze([ | ||||
threadTypes.COMMUNITY_ROOT, | threadTypes.COMMUNITY_ROOT, | ||||
threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT, | threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT, | ||||
threadTypes.GENESIS, | threadTypes.GENESIS, | ||||
]); | ]); | ||||
export const communitySubthreads: $ReadOnlyArray<number> = Object.freeze([ | |||||
threadTypes.COMMUNITY_OPEN_SUBTHREAD, | |||||
threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD, | |||||
threadTypes.COMMUNITY_SECRET_SUBTHREAD, | |||||
threadTypes.COMMUNITY_SECRET_ANNOUNCEMENT_SUBTHREAD, | |||||
]); | |||||
export function threadTypeIsCommunityRoot(threadType: ThreadType): boolean { | export function threadTypeIsCommunityRoot(threadType: ThreadType): boolean { | ||||
return communityThreadTypes.includes(threadType); | return communityThreadTypes.includes(threadType); | ||||
} | } | ||||
export const threadPermissions = Object.freeze({ | export const threadPermissions = Object.freeze({ | ||||
KNOW_OF: 'know_of', | KNOW_OF: 'know_of', | ||||
MEMBERSHIP_DEPRECATED: 'membership', | MEMBERSHIP_DEPRECATED: 'membership', | ||||
VISIBLE: 'visible', | VISIBLE: 'visible', | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |