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

    Interface CharacterCountOptions

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

    Properties

    limit: undefined | null | number

    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