@umbraco-cms/backoffice
    Preparing search index...

    Interface CharacterCountOptions

    interface CharacterCountOptions {
        autoTrim?: boolean;
        limit: number | null | undefined;
        mode: "nodeSize" | "textSize";
        textCounter: (text: string) => number;
        wordCounter: (text: string) => number;
    }
    Index
    autoTrim?: boolean

    Sets whether the content will be automatically trimmed when programatically setting content over the limit. If set to false, the user will be able to trim the text manually.

    true
    
    false
    
    limit: number | null | undefined

    The maximum number of characters that should be allowed. Defaults to 0.

    null
    
    180
    
    mode: "nodeSize" | "textSize"

    The mode by which the size is calculated. If set to textSize, the textContent of the document is used. If set to nodeSize, the nodeSize of the document is used.

    'textSize'
    
    'textSize'
    
    textCounter: (text: string) => number

    The text counter function to use. Defaults to a simple character count.

    (text) => text.length
    
    (text) => [...new Intl.Segmenter().segment(text)].length
    
    wordCounter: (text: string) => number

    The word counter function to use. Defaults to a simple word count.

    (text) => text.split(' ').filter(word => word !== '').length
    
    (text) => text.split(/\s+/).filter(word => word !== '').length