main

mattermost/focalboard

Last updated at: 29/12/2023 09:51

h1Block.tsx

TLDR

This file exports a H1Block type and a createH1Block function. The H1Block type is a specific type of ContentBlock with a type property set to 'h1'. The createH1Block function creates a new instance of H1Block by extending a Block and setting its type property to 'h1'.

Methods

None

Classes

None

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ContentBlock} from './contentBlock'
import {Block, createBlock} from './block'

type H1Block = ContentBlock & {
    type: 'h1'
}

function createH1Block(block?: Block): H1Block {
    return {
        ...createBlock(block),
        type: 'h1',
    }
}

export {H1Block, createH1Block}