From b7d2a253833e9a0f8035703a2285e662aa0e11fb Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 18 Dec 2024 07:57:18 -0800 Subject: [PATCH] document ffi data providers (#5913) --- ffi/capi/bindings/dart/DataProvider.g.dart | 5 +++++ ffi/capi/bindings/js/DataProvider.d.ts | 5 +++++ ffi/capi/bindings/js/DataProvider.mjs | 5 +++++ ffi/capi/src/provider.rs | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/ffi/capi/bindings/dart/DataProvider.g.dart b/ffi/capi/bindings/dart/DataProvider.g.dart index 69990cac6fc..c387290e699 100644 --- a/ffi/capi/bindings/dart/DataProvider.g.dart +++ b/ffi/capi/bindings/dart/DataProvider.g.dart @@ -4,6 +4,11 @@ part of 'lib.g.dart'; /// An ICU4X data provider, capable of loading ICU4X data keys from some source. /// +/// Currently the only source supported is loading from "blob" formatted data from a bytes buffer or the file system. +/// +/// If you wish to use ICU4X's builtin "compiled data", use the version of the constructors that do not have `_with_provider` +/// in their names. +/// /// See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. final class DataProvider implements ffi.Finalizable { final ffi.Pointer _ffi; diff --git a/ffi/capi/bindings/js/DataProvider.d.ts b/ffi/capi/bindings/js/DataProvider.d.ts index fc8cd56c830..7e8438446f9 100644 --- a/ffi/capi/bindings/js/DataProvider.d.ts +++ b/ffi/capi/bindings/js/DataProvider.d.ts @@ -6,6 +6,11 @@ import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** An ICU4X data provider, capable of loading ICU4X data keys from some source. * +*Currently the only source supported is loading from "blob" formatted data from a bytes buffer or the file system. +* +*If you wish to use ICU4X's builtin "compiled data", use the version of the constructors that do not have `_with_provider` +*in their names. +* *See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. */ export class DataProvider { diff --git a/ffi/capi/bindings/js/DataProvider.mjs b/ffi/capi/bindings/js/DataProvider.mjs index b7116e95bd9..157044cbd67 100644 --- a/ffi/capi/bindings/js/DataProvider.mjs +++ b/ffi/capi/bindings/js/DataProvider.mjs @@ -7,6 +7,11 @@ import * as diplomatRuntime from "./diplomat-runtime.mjs"; /** An ICU4X data provider, capable of loading ICU4X data keys from some source. * +*Currently the only source supported is loading from "blob" formatted data from a bytes buffer or the file system. +* +*If you wish to use ICU4X's builtin "compiled data", use the version of the constructors that do not have `_with_provider` +*in their names. +* *See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. */ const DataProvider_box_destroy_registry = new FinalizationRegistry((ptr) => { diff --git a/ffi/capi/src/provider.rs b/ffi/capi/src/provider.rs index f82cd4fd0e1..464e3c069f0 100644 --- a/ffi/capi/src/provider.rs +++ b/ffi/capi/src/provider.rs @@ -23,6 +23,11 @@ pub mod ffi { #[diplomat::opaque] /// An ICU4X data provider, capable of loading ICU4X data keys from some source. + /// + /// Currently the only source supported is loading from "blob" formatted data from a bytes buffer or the file system. + /// + /// If you wish to use ICU4X's builtin "compiled data", use the version of the constructors that do not have `_with_provider` + /// in their names. #[diplomat::rust_link(icu_provider, Mod)] pub struct DataProvider(pub DataProviderInner);