@readapt/settings
TypeScript icon, indicating that this package has built-in type declarations

1.8.4 • Public • Published

@readapt/settings

Readapt adaptations are based on a settings profile. This package contains Settings models, type definitions and a few utility functions to easily build Settings in order to adapt text.

Installation

  1. Install @readapt/settings package:
     npm install @readapt/settings

How to build settings?

Use buildDefaultSettings() to build default settings

    import { buildDefaultSettings } from '@readapt/settings'

    const defaultSettings = buildDefaultSettings('en')

Then you can customize it using available options. For example:

    import { colors, lineSpacingOptions, opacityOptions, silentLetterOpacityOptions, overrideDefaultLetters } from '@readapt/settings'

    const mySettings = {
      ...defaultSettingsEn,
      shadeAlternateLinesActive: true,
      shadeAlternateLinesOpacity: opacityOptions[1].value,
      silentLetterActive: true,
      silentLetterOpacity: silentLetterOpacityOptions[2].value,
      lineSpacing: lineSpacingOptions[1].value,
      letters: overrideDefaultLetters('en', [
        { key: '2', value: 'd', bold: false, color: colors[0], active: true },
        { key: '8', value: 'm', bold: false, color: colors[1], active: true },
        { key: '7', value: 'n', bold: false, color: colors[2], active: true },
        { key: '3', value: 'p', bold: false, color: colors[3], active: true },
        { key: '1', value: 'b', bold: false, color: colors[4], active: true },
        { key: '24', value: 'w', bold: false, color: colors[7], active: true },
        { key: '19', value: 'u', bold: false, color: colors[8], active: true },
        { key: '4', value: 'q', bold: false, color: colors[11], active: true }
      ])
    }

Each Option is typed to easily know available values. Explore our source code to check all available options.

overrideDefaultLetters() and overrideDefaultPhonemes() are two methods to easily customize letters and phonemes.

getLangConfig() returns available phonemes and letters for each language.

Readme

Keywords

none

Package Sidebar

Install

npm i @readapt/settings

Weekly Downloads

34

Version

1.8.4

License

Apache-2.0

Unpacked Size

74.2 kB

Total Files

91

Last publish

Collaborators

  • panzerdp
  • readapt-contentsquare
  • sylvinus
  • eboukamza
  • aradjdi-contentsquare