Options
All
  • Public
  • Public/Protected
  • All
Menu

Config is a class for management configuration file of nd command

class
version

1.0

Hierarchy

  • Config

Index

Constructors

constructor

  • new Config(path: string, option?: undefined | object): Config

Properties

Optional _color

_color: undefined | false | true

Optional _fullname

_fullname: undefined | string

Optional _novelLocation

_novelLocation: undefined | string

Optional _option

_option: undefined | object

Optional _outputType

_outputType: "short" | "long"

Optional _token

_token: undefined | string

Optional _version

_version: undefined | number

configLocation

configLocation: string

Static _CONFIG

_CONFIG: Config

Methods

_isQuite

  • _isQuite(): undefined | false | true

_setter

  • _setter(key: "_fullname" | "_token" | "_outputType" | "_color" | "_novelLocation", value: any | undefined): void
  • Parameters

    • key: "_fullname" | "_token" | "_outputType" | "_color" | "_novelLocation"
    • value: any | undefined

    Returns void

create

  • create(force?: boolean): void
  • create yml file to {@link DEFAULT_CONFIG_FILE} file by current memory setting

    throws

    {@link CreateConfigError}

    Parameters

    • Default value force: boolean = false

      force create file, even it exist.

    Returns void

getColor

  • getColor(): boolean

getFullname

  • getFullname(): string

getNovelLocation

  • getNovelLocation(): string

getOutputType

  • getOutputType(): "long" | "short"

getToken

  • getToken(): string

getVersion

  • getVersion(): number

load

  • load(bypass?: boolean): void
  • Load config file from system and save to memory. This command also valid the correctness of the file.

    throws

    {@link ConfigFailError} exception

    Parameters

    • Default value bypass: boolean = false

    Returns void

save

  • save(): void

setColor

  • setColor(color: string | undefined): void

setFullname

  • setFullname(id: string | undefined): void

setNovelLocation

  • setNovelLocation(location: string | undefined): void

setOption

  • setOption(option: object): void

setOutputType

  • setOutputType(type: "long" | "short" | undefined): void

setToken

  • setToken(token: string | undefined): void

setVersion

  • setVersion(version: string): void

showStatus

  • showStatus(options?: undefined | object): void

updateByOption

  • updateByOption(option: object): void

valid

Static Initial

  • Initial(force?: boolean): Config

Static Load

  • Load(option?: undefined | object): Config

Generated using TypeDoc