intl/l10n/mozIDOMLocalization.idl
author Sylvestre Ledru <sledru@mozilla.com>
Wed, 10 Oct 2018 17:39:11 +0200
changeset 1723497 2aa30ed48cd8ecbab39658ade7dc17c3e5bd90be
parent 1713313 31941d904a7c3df53ed5b4c9ecdc40025d865dfb
child 1778695 d1c2a809f217edeedcda409ed21acabcb6908f2e
child 1790101 d2a3329180deb01d555f8b77d1bc93729581b30a
child 1819607 d5081517556cdbef38a721fe7c2572d17e81bf8b
child 1824008 4c01fe62eb32c9a2cbfd5de6f68f2788a3df309b
child 1830639 06ea8ac524bd2dbe9fab1ef886d7727706dfdfe4
child 1866021 44ca4acca4e3dea0fb200436679c0a83372b689e
permissions -rw-r--r--
reformat dom/

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

webidl Document;
webidl Element;
webidl Node;

[scriptable, uuid(7c468500-541f-4fe0-98c9-92a53b63ec8d)]
interface mozIDOMLocalization : nsISupports
{
  unsigned long addResourceIds(in Array<AString> resourceIds, in bool aEager);
  unsigned long removeResourceIds(in Array<AString> resourceIds);
  void registerObservers();

  Promise formatMessages(in Array<jsval> aKeys);
  Promise formatValues(in Array<jsval> aKeys);
  Promise formatValue(in AString aId, [optional] in jsval aArgs);

  Promise translateFragment(in Node aNode);
  Promise translateElements(in Array<Element> aElements);

  void connectRoot(in Element aElement);
  Promise translateRoots();
  readonly attribute Promise ready;
};