@sanity/orderable-document-list 1.2.2 → 1.3.0

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