commentBlock.ts
TLDR
This file, commentBlock.ts
, exports a function and a type related to comment blocks.
Methods
createCommentBlock
This method is used to create a comment block. It takes an optional parameter block
of type Block
and returns a CommentBlock
. The returned object extends the Block
type and has an additional property type
with a value of 'comment'
.
Classes
None
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Block, createBlock} from './block'
type CommentBlock = Block & {
type: 'comment'
}
function createCommentBlock(block?: Block): CommentBlock {
return {
...createBlock(block),
type: 'comment',
}
}
export {CommentBlock, createCommentBlock}