📆 Don't miss our Sanity Showcase virtual meetup on March 20th!
@beta
type

AutocompleteString

Enhances VSCode autocomplete by using a distinct type for strings.

AllowOtherStrings is defined as string & {}, an intersection that behaves like string but is treated differently by TypeScript's type system for internal processing. This helps in improving the specificity and relevance of autocomplete suggestions by potentially prioritizing IntrinsicTypeName over general string inputs, addressing issues where string type suggestions might overshadow more useful specific literals.

Import

import {type AutocompleteString} from 'sanity'

Signature

type AutocompleteString = string & {}
type AutocompleteString = string & {}
sanity@3.79.0