Definition
Translator and Language Detector APIs defines LanguageDetector
[Exposed=Window, SecureContext]
interface LanguageDetector {
static Promise<LanguageDetector> create(
optional LanguageDetectorCreateOptions options = {}
);
static Promise<Availability> availability(
optional LanguageDetectorCreateCoreOptions options = {}
);
Promise<sequence<LanguageDetectionResult>> detect(
DOMString input,
optional LanguageDetectorDetectOptions options = {}
);
readonly attribute FrozenArray<DOMString>? expectedInputLanguages;
Promise<double> measureInputUsage(
DOMString input,
optional LanguageDetectorDetectOptions options = {}
);
readonly attribute unrestricted double inputQuota;
};
LanguageDetector includes DestroyableModel;
Consolidated IDL (across mixin and partials)
[Exposed=Window, SecureContext]
interface LanguageDetector {
static Promise<LanguageDetector> create(
optional LanguageDetectorCreateOptions options = {}
);
static Promise<Availability> availability(
optional LanguageDetectorCreateCoreOptions options = {}
);
Promise<sequence<LanguageDetectionResult>> detect(
DOMString input,
optional LanguageDetectorDetectOptions options = {}
);
readonly attribute FrozenArray<DOMString>? expectedInputLanguages;
Promise<double> measureInputUsage(
DOMString input,
optional LanguageDetectorDetectOptions options = {}
);
readonly attribute unrestricted double inputQuota;
undefined destroy();
};