Skip to content

Commit

Permalink
chore: updating usePerspective types to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanl17 committed Feb 11, 2025
1 parent 824c791 commit 45b97e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/sanity/src/core/perspective/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {type ClientPerspective, type ReleaseId} from '@sanity/client'
import {type ReleaseDocument} from '../releases/store/types'

/**
* @internal
* @beta
*/
export type SelectedPerspective = ReleaseDocument | 'published' | 'drafts'

/**
* @internal
* @beta
*/
export type PerspectiveStack = ExtractArray<ClientPerspective>

/**
* @internal
* @beta
*/
export interface PerspectiveContextValue {
/* The selected perspective name, it could be a release or Published */
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/perspective/usePerspective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {PerspectiveContext} from 'sanity/_singletons'
import {type PerspectiveContextValue} from './types'

/**
* @internal
* @beta
*/
export function usePerspective(): PerspectiveContextValue {
const context = useContext(PerspectiveContext)
Expand Down
22 changes: 16 additions & 6 deletions packages/sanity/src/core/releases/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,26 @@ import {RELEASE_DOCUMENT_TYPE} from './constants'
import {type MetadataWrapper} from './createReleaseMetadataAggregator'
import {type ReleasesReducerAction, type ReleasesReducerState} from './reducer'

/** @internal */
/**
* @beta
*/
export type ReleaseType = 'asap' | 'scheduled' | 'undecided'

/**
*@internal
* @beta
*/
export type ReleaseState = 'active' | 'archived' | 'published' | 'scheduled' | 'scheduling'
export type ReleaseState =
| 'active'
| 'archiving'
| 'unarchiving'
| 'archived'
| 'published'
| 'publishing'
| 'scheduled'
| 'scheduling'

/**
*@internal
* @beta
*/
export type ReleaseFinalDocumentState = {
/** Document ID */
Expand All @@ -24,8 +35,7 @@ export type ReleaseFinalDocumentState = {
}

/**
* TODO: When made `beta`, update the PublishDocumentVersionEvent to use this type
* @internal
* @beta
*/
export interface ReleaseDocument extends SanityDocument {
/**
Expand Down

0 comments on commit 45b97e5

Please sign in to comment.