DataProvider.d.ts (2047B)
1 // generated by diplomat-tool 2 import type { DataError } from "./DataError" 3 import type { LocaleFallbacker } from "./LocaleFallbacker" 4 import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; 5 6 7 /** 8 * An ICU4X data provider, capable of loading ICU4X data keys from some source. 9 * 10 * Currently the only source supported is loading from "blob" formatted data from a bytes buffer or the file system. 11 * 12 * If you wish to use ICU4X's builtin "compiled data", use the version of the constructors that do not have `_with_provider` 13 * in their names. 14 * 15 * See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. 16 */ 17 18 19 export class DataProvider { 20 get ffiValue(): pointer; 21 22 23 /** 24 * Creates a provider that tries the current provider and then, if the current provider 25 * doesn't support the data key, another provider `other`. 26 * 27 * This takes ownership of the `other` provider, leaving an empty provider in its place. 28 * 29 * See the [Rust documentation for `ForkByMarkerProvider`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/type.ForkByMarkerProvider.html) for more information. 30 */ 31 forkByMarker(other: DataProvider): void; 32 33 /** 34 * Same as `fork_by_key` but forks by locale instead of key. 35 * 36 * See the [Rust documentation for `IdentifierNotFoundPredicate`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/predicates/struct.IdentifierNotFoundPredicate.html) for more information. 37 */ 38 forkByLocale(other: DataProvider): void; 39 40 /** 41 * See the [Rust documentation for `new`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new) for more information. 42 * 43 * Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html) 44 */ 45 enableLocaleFallbackWith(fallbacker: LocaleFallbacker): void; 46 }