sit-onyx 1.0.0-beta.97 → 1.0.0-beta.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { type App, type ComputedRef, type InjectionKey, type MaybeRef } from "vue";
1
+ import { type App, type InjectionKey, type MaybeRef } from "vue";
2
2
  import type { FlattenedKeysOf } from "../types/i18n";
3
3
  import type { DeepPartial } from "../types/utils";
4
4
  import enUS from "./locales/en-US.json";
@@ -56,7 +56,7 @@ export type ProvideI18nOptions = {
56
56
  *
57
57
  * Note: If a custom `t` function is used, passed messages will not be used.
58
58
  */
59
- t?: ComputedRef<TranslationFunction>;
59
+ t?: MaybeRef<TranslationFunction>;
60
60
  };
61
61
  export type TranslationFunction = (key: OnyxTranslationKey,
62
62
  /** Named values to interpolate into the translation. The property `n` is special as it represents the number of elements for pluralization. */
@@ -68,23 +68,23 @@ export declare const I18N_INJECTION_KEY: InjectionKey<ReturnType<typeof createI1
68
68
  * Creates a new i18n instance.
69
69
  */
70
70
  declare const createI18n: (options?: ProvideI18nOptions) => {
71
- t: ComputedRef<TranslationFunction>;
72
- locale: ComputedRef<string>;
71
+ t: Readonly<import("vue").Ref<TranslationFunction, TranslationFunction>>;
72
+ locale: Readonly<import("vue").Ref<string, string>>;
73
73
  };
74
74
  /**
75
75
  * Provides a global i18n instance that is used by onyx.
76
76
  * Must only be called once in the `App.vue` file of a project that consumes onyx.
77
77
  */
78
78
  export declare const provideI18n: (app: App, options?: ProvideI18nOptions) => {
79
- t: ComputedRef<TranslationFunction>;
80
- locale: ComputedRef<string>;
79
+ t: Readonly<import("vue").Ref<TranslationFunction, TranslationFunction>>;
80
+ locale: Readonly<import("vue").Ref<string, string>>;
81
81
  };
82
82
  /**
83
83
  * Injects the onyx i18n instance.
84
84
  * Creates a fallback if provide was never called.
85
85
  */
86
86
  export declare const injectI18n: () => {
87
- t: ComputedRef<TranslationFunction>;
88
- locale: ComputedRef<string>;
87
+ t: Readonly<import("vue").Ref<TranslationFunction, TranslationFunction>>;
88
+ locale: Readonly<import("vue").Ref<string, string>>;
89
89
  };
90
90
  export {};