@sanity/orderable-document-list 1.2.2 → 1.2.3

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.
@@ -0,0 +1,44 @@
1
+ import type {ComponentType} from 'react'
2
+ import type {ConfigContext} from 'sanity'
3
+ import {FieldDefinitionBase} from 'sanity'
4
+ import {ListItem} from 'sanity/structure'
5
+ import {MenuItem} from 'sanity/structure'
6
+ import type {SortOrdering} from 'sanity'
7
+ import {StringDefinition} from 'sanity'
8
+ import {StructureBuilder} from 'sanity/structure'
9
+ import {WidenInitialValue} from 'sanity'
10
+ import {WidenValidation} from 'sanity'
11
+
12
+ declare type NewItemPosition = 'after' | 'before'
13
+
14
+ export declare function orderableDocumentListDeskItem(config: OrderableListConfig): ListItem
15
+
16
+ export declare interface OrderableListConfig {
17
+ type: string
18
+ id?: string
19
+ title?: string
20
+ icon?: ComponentType
21
+ params?: Record<string, unknown>
22
+ filter?: string
23
+ menuItems?: MenuItem[]
24
+ createIntent?: boolean
25
+ context: ConfigContext
26
+ S: StructureBuilder
27
+ }
28
+
29
+ export declare const orderRankField: (config: RankFieldConfig) => {
30
+ type: 'string'
31
+ name: 'orderRank'
32
+ } & Omit<StringDefinition, 'preview'> &
33
+ FieldDefinitionBase &
34
+ WidenValidation &
35
+ WidenInitialValue
36
+
37
+ export declare const orderRankOrdering: SortOrdering
38
+
39
+ export declare interface RankFieldConfig {
40
+ type: string
41
+ newItemPosition?: NewItemPosition
42
+ }
43
+
44
+ export {}
package/lib/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import {ComponentType} from 'react'
1
+ import type {ComponentType} from 'react'
2
2
  import type {ConfigContext} from 'sanity'
3
3
  import {FieldDefinitionBase} from 'sanity'
4
4
  import {ListItem} from 'sanity/structure'
5
5
  import {MenuItem} from 'sanity/structure'
6
- import {SortOrdering} from 'sanity'
6
+ import type {SortOrdering} from 'sanity'
7
7
  import {StringDefinition} from 'sanity'
8
8
  import {StructureBuilder} from 'sanity/structure'
9
9
  import {WidenInitialValue} from 'sanity'