Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TranslatorConnector

Hierarchy

  • DataConnector<Language, Language, { language: string }>
    • TranslatorConnector

Implements

Index

Constructors

constructor

Properties

Private _serverSettings

_serverSettings: any

Private _translationsUrl

_translationsUrl: any

Methods

fetch

  • fetch(opts: { language: string }): Promise<Language>
  • Retrieve an item from the data connector.

    Parameters

    • opts: { language: string }
      • language: string

    Returns Promise<Language>

    A promise that resolves with a data payload if available.

    Notes

    The promise returned by this method may be rejected if an error occurs in retrieving the data. Nonexistence of an id will succeed with undefined.

list

  • list(query?: string): Promise<{ ids: { language: string }[]; values: Language[] }>
  • Retrieve the list of items available from the data connector.

    Parameters

    • Optional query: string

      The optional query filter to apply to the connector request.

    Returns Promise<{ ids: { language: string }[]; values: Language[] }>

    A promise that always rejects with an error.

    Notes

    Subclasses should reimplement if they support a back-end that can list.

remove

  • remove(id: { language: string }): Promise<any>
  • Remove a value using the data connector.

    Parameters

    • id: { language: string }

      The identifier for the data being removed.

      • language: string

    Returns Promise<any>

    A promise that always rejects with an error.

    Notes

    Subclasses should reimplement if they support a back-end that can remove.

save

  • save(id: { language: string }, value: Language): Promise<any>
  • Save a value using the data connector.

    Parameters

    • id: { language: string }

      The identifier for the data being saved.

      • language: string
    • value: Language

      The data being saved.

    Returns Promise<any>

    A promise that always rejects with an error.

    Notes

    Subclasses should reimplement if they support a back-end that can save.

Generated using TypeDoc