@sanity/document-internationalization 1.0.3 → 1.0.4

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.
@@ -9,13 +9,28 @@ import {ListItem} from 'sanity/desk'
9
9
  import {ListItemBuilder} from 'sanity/desk'
10
10
  import {Plugin as Plugin_2} from 'sanity'
11
11
  import type {PluginOptions} from 'sanity'
12
- import type {SanityClient} from '@sanity/client'
12
+ import {SanityClient} from '@sanity/client'
13
13
  import {SanityDocument} from 'sanity'
14
+ import {SanityDocument as SanityDocument_2} from '@sanity/client'
14
15
  import {Schema} from 'sanity'
15
16
  import {SchemaType} from 'sanity'
16
17
  import type {SlugIsUniqueValidator} from 'sanity'
17
18
  import {StructureBuilder} from 'sanity/desk'
18
19
 
20
+ declare type ApplyConfigOptionalKeys =
21
+ | 'shouldReload'
22
+ | 'languagesLoader'
23
+ | 'fallbackLanguageSelect'
24
+ | 'customFlagComponents'
25
+
26
+ declare type ApplyConfigResult = Omit<
27
+ Required<{
28
+ [K in keyof Ti18nConfig]: Required<Ti18nConfig[K]>
29
+ }>,
30
+ ApplyConfigOptionalKeys
31
+ > &
32
+ Pick<Ti18nConfig, ApplyConfigOptionalKeys>
33
+
19
34
  export declare function createDeleteAction(pluginConfig: Ti18nConfig): DocumentActionComponent
20
35
 
21
36
  export declare function createDuplicateAction(pluginConfig: Ti18nConfig): DocumentActionComponent
@@ -184,6 +199,22 @@ export declare const UiMessages: {
184
199
  }
185
200
  }
186
201
 
202
+ export declare function updateIntlFieldsForDocument(
203
+ client: SanityClient,
204
+ config: ApplyConfigResult,
205
+ document: SanityDocument_2,
206
+ baseDocument?: SanityDocument_2
207
+ ): Promise<void>
208
+
209
+ export declare function useConfig(pluginConfig: Ti18nConfig, type?: string): ApplyConfigResult
210
+
211
+ export declare function useDelayedFlag(
212
+ value?: boolean,
213
+ timeout?: number,
214
+ delayedOn?: boolean,
215
+ delayedOff?: boolean
216
+ ): boolean
217
+
187
218
  export declare function withDocumentI18nPlugin(
188
219
  plugins: PluginOptions[] | ((config: Ti18nConfig) => PluginOptions[]),
189
220
  config: Ti18nConfig & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/document-internationalization",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Provides document level translations for Sanity Studio",
5
5
  "keywords": [
6
6
  "sanity",
package/src/index.ts CHANGED
@@ -3,4 +3,6 @@ export * from './actions'
3
3
  export * from './structure'
4
4
  export * from './validators'
5
5
  export * from './withDocumentI18nPlugin'
6
+ export * from './utils/updateIntlFieldsForDocument'
7
+ export * from './hooks'
6
8
  export {documentI18n} from './documentI18n'