Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Dictionary

Manages dictionary communication with a server.

Hierarchy

Index

Constructors

constructor

  • new Dictionary(baseUrl?: string, cacheTimeout?: number, responseTimeout?: number): Dictionary
  • Creates a new managed AJAX instance.

    Parameters

    • Default value baseUrl: string = ""
         Base URL of the server.
      
    • Default value cacheTimeout: number = 3600000
         Use 0 milliseconds to turn off all cache systems. Default is 1
         hour.
      
    • Default value responseTimeout: number = 60000
         Time in milliseconds to wait for a server response. Default are 60
         seconds.
      

    Returns Dictionary

Properties

baseUrl

baseUrl: string

Base URL of the server

cacheTimeout

cacheTimeout: number

Set to 0 to turn off all cache systems

responseTimeout

responseTimeout: number

Time in milliseconds to wait for a server response

Static Readonly FILE_EXTENSION

FILE_EXTENSION: ".txt" = ".txt"

File extension of dictionary entries.

Static Readonly FILE_SEPARATOR

FILE_SEPARATOR: "-" = "-"

Character to separate a base file name from its page index.

Static Readonly LINE_SEPARATOR

LINE_SEPARATOR: "" = ""

Line character to separate sections.

Static Readonly PAIR_SEPARATOR

PAIR_SEPARATOR: ":" = ":"

Character to separate a category from its values.

Static Readonly VALUE_SEPARATOR

VALUE_SEPARATOR: ";" = ";"

Character to separate a category's values.

Methods

hasOpenRequest

  • hasOpenRequest(): boolean

loadEntry

  • loadEntry(baseName: string, pageIndex?: number): Promise<IDictionaryEntry | undefined>
  • Loads a dictionary entry from the server.

    Parameters

    • baseName: string
         Base name of the translation file
      
    • Default value pageIndex: number = 0
         Index of the entry page to load
      

    Returns Promise < IDictionaryEntry | undefined >

request

Static parse

Static stringify

Generated using TypeDoc