index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/legacy/fixtures
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/legacy/fixtures/schemas/reference.ts
export default { name: 'reference', types: [ { name: 'blogpost', type: 'object', fields: [ { name: 'petReferenceArray', type: 'array', title: 'Array of reference to pets in a list', description: 'This array are defined in the field.', o...
2,300
0
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/legacy/fixtures
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/legacy/fixtures/schemas/selects.ts
// eslint-disable-next-line max-len const pets = 'Alpaca;Bali cattle;Cat;Cattle;Chicken;Dog;Domestic Bactrian camel;Domestic canary;Domestic dromedary camel;Domestic duck;Domestic goat;Domestic goose;Domestic guineafowl;Domestic hedgehog;Domestic pig;Domestic pigeon;Domestic rabbit;Domestic silkmoth;Domestic silver f...
2,301
0
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/legacy/fixtures
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/legacy/fixtures/schemas/vega.ts
//import {atLeast, atMost, required} from './sanity/validates' //import {image, imageVersion, richText} from './sanity/types/bundled' // export default { name: 'vega', types: [ { name: 'simple', type: 'object', fields: [ { name: 'someString', type: 'string', ...
2,302
0
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test
petrpan-code/sanity-io/sanity/packages/@sanity/schema/test/validation/validation.test.ts
import {flatten} from 'lodash' import {validateSchema} from '../../src/sanity/validateSchema' describe('Validation test', () => { test('assigns/populates `_problems` property', () => { const schemaDef = [ { type: 'array', name: 'myArray', of: [{type: 'string'}, {type: 'string'}], ...
2,303
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/.depcheckignore.json
{ "ignore": [ "@juggle/resize-observer", "@optimize-lodash/rollup-plugin", "@popperjs/core", "@rexxars/react-sortable-hoc", "@sanity/bifur-client", "@sanity/mutator", "@sanity/pkg-utils", "@sanity/types", "@sanity/ui", "_self_", "boundless-arrow-key-navigation", "elemen...
2,304
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/.eslintrc.cjs
'use strict' const path = require('path') const ROOT_PATH = path.resolve(__dirname, '../../..') module.exports = { rules: { 'import/no-extraneous-dependencies': ['error', {packageDir: [ROOT_PATH, __dirname]}], }, }
2,305
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/LICENSE
MIT License Copyright (c) 2016 - 2023 Sanity.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
2,306
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/jest.config.cjs
'use strict' const {createJestConfig} = require('../../../test/config.cjs') module.exports = createJestConfig({ displayName: require('./package.json').name, testEnvironment: 'node', })
2,307
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/package.config.ts
import {defineConfig} from '@sanity/pkg-utils' import baseConfig from '../../../package.config' export default defineConfig({ ...baseConfig, extract: { ...baseConfig.extract, rules: { ...baseConfig.extract?.rules, 'ae-forgotten-export': 'error', 'ae-incompatible-release-tags': 'error', ...
2,308
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/package.json
{ "name": "@sanity/types", "version": "3.20.1", "description": "Type definitions for common Sanity data structures", "keywords": [ "sanity", "cms", "headless", "realtime", "content", "types", "typescript" ], "homepage": "https://www.sanity.io/", "bugs": { "url": "https://gi...
2,309
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/tsconfig.json
{ "extends": "../../../tsconfig.settings", "include": ["./src"], "compilerOptions": { "composite": true, "rootDir": ".", "outDir": "./lib/dts", "jsx": "react-jsx", "paths": { "_self_": ["./src"] } } }
2,310
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/types/tsconfig.lib.json
{ "extends": "../../../tsconfig.settings", "include": ["./src"], "compilerOptions": { "composite": true, "rootDir": ".", "outDir": "./lib/dts", "jsx": "react-jsx", "paths": { "_self_": ["./src"] } } }
2,311
0
petrpan-code/sanity-io/sanity/packages/@sanity/types
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/helpers.ts
export function isObject(obj: unknown): obj is Record<string, unknown> { return typeof obj === 'object' && obj !== null && !Array.isArray(obj) }
2,312
0
petrpan-code/sanity-io/sanity/packages/@sanity/types
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/index.ts
export * from './assets' export * from './crossDatasetReference' export * from './documents' export * from './images' export * from './markers' export * from './mutations' export * from './paths' export * from './portableText' export * from './reference' export * from './schema' export * from './slug' export * from './...
2,313
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/assets/asserters.ts
import {isObject} from '../helpers' import {isReference} from '../reference' import type {Image} from './types' /** @public */ export function isImage(value: unknown): value is Image { return isObject(value) && isReference(value.asset) && value.asset._ref.startsWith('image-') }
2,314
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/assets/index.ts
export * from './asserters' export * from './types'
2,315
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/assets/types.ts
import type {ComponentType} from 'react' import type {Reference} from '../reference' import type {SanityDocument} from '../documents' /** @public */ // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface EmptyProps {} /** @public */ export interface File { [key: string]: unknown // We al...
2,316
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/crossDatasetReference/asserters.ts
import {isObject} from '../helpers' import type {CrossDatasetReferenceValue} from './types' /** @beta */ export function isCrossDatasetReference( reference: unknown, ): reference is CrossDatasetReferenceValue { return ( isObject(reference) && typeof reference._ref === 'string' && typeof reference._data...
2,317
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/crossDatasetReference/index.ts
export * from './asserters' export * from './types'
2,318
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/crossDatasetReference/types.ts
import type {ComponentType} from 'react' import type {Path} from '../paths' import type {SanityDocument} from '../documents' import type {ObjectSchemaType, PreviewConfig} from '../schema' import type {ReferenceFilterOptions} from '../reference' /** @beta */ export interface CrossDatasetReferenceValue { _type: string...
2,319
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/documents/asserters.ts
import {isObject} from '../helpers' import type {KeyedObject, SanityDocument, TypedObject} from './types' /** @public */ export function isSanityDocument(document: unknown): document is SanityDocument { return ( isObject(document) && typeof document._id === 'string' && typeof document._type === 'string' ) } /...
2,320
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/documents/index.ts
export * from './types' export * from './asserters'
2,321
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/documents/types.ts
/** @public */ export interface SanityDocument { _id: string _type: string _createdAt: string _updatedAt: string _rev: string [key: string]: unknown } /** * Similar to `SanityDocument` but only requires the `_id` and `_type` * * @see SanityDocument * * @public */ export interface SanityDocumentLike {...
2,322
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/images/index.ts
export * from './types'
2,323
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/images/types.ts
/** * NOTE: These are query parameters, so they will eventually be encoded as strings. * However, since most/all query parameter encoders will accept numbers and encode * them as strings, we'll use `string| number` where applicable, as it makes it easier * to use in places that do calculations and such. * * @inte...
2,324
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/markers/asserters.ts
import type {ValidationMarker} from './types' /** @internal */ export function isValidationErrorMarker( marker: ValidationMarker, ): marker is ValidationMarker & {level: 'error'} { return marker.level === 'error' } /** @internal */ export function isValidationWarningMarker( marker: ValidationMarker, ): marker i...
2,325
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/markers/index.ts
export * from './asserters' export * from './types'
2,326
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/markers/types.ts
import type {ValidationError} from '../validation' import type {Path} from '../paths' /** @public */ export interface ValidationMarker { level: 'error' | 'warning' | 'info' item: ValidationError /** * The sanity path _relative to the root of the current document_ to this * marker. * * NOTE: Sanity pa...
2,327
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/mutations/asserters.ts
import type {TransactionLogMutation} from '../transactionLog' import type { CreateIfNotExistsMutation, CreateMutation, CreateOrReplaceMutation, DeleteMutation, Mutation, PatchMutation, } from './types' /** @internal */ export function isCreateMutation( mutation: Mutation | TransactionLogMutation, ): muta...
2,328
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/mutations/index.ts
export * from './types' export * from './asserters'
2,329
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/mutations/types.ts
/** @internal */ export type InsertPatch = | {before: string; items: unknown[]} | {after: string; items: unknown[]} | {replace: string; items: unknown[]} /** * NOTE: this is actually incorrect/invalid, but implemented as-is for backwards compatibility * * @internal */ export interface PatchOperations { set...
2,330
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/paths/asserters.ts
import type {PathSegment, KeyedSegment, IndexTuple} from './types' const reKeySegment = /_key\s*==\s*['"](.*)['"]/ const reIndexTuple = /^\d*:\d*$/ /** @internal */ export function isIndexSegment(segment: PathSegment): segment is number { return typeof segment === 'number' || (typeof segment === 'string' && /^\[\d+...
2,331
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/paths/index.ts
export * from './types' export * from './asserters'
2,332
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/paths/types.ts
/** @public */ export type KeyedSegment = {_key: string} /** @public */ export type IndexTuple = [number | '', number | ''] /** @public */ export type PathSegment = string | number | KeyedSegment | IndexTuple /** @public */ export type Path = PathSegment[]
2,333
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/portableText/asserters.ts
import type {PortableTextTextBlock, PortableTextSpan, PortableTextObject} from './types' function isRecord(value: unknown): value is Record<string, unknown> { return !!value && (typeof value == 'object' || typeof value == 'function') } /** * Assert that a given object is a portable-text text-block type object * ...
2,334
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/portableText/index.ts
export * from './asserters' export * from './types'
2,335
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/portableText/types.ts
/** @alpha */ export type PortableTextBlock = PortableTextTextBlock | PortableTextObject /** @alpha */ export interface PortableTextTextBlock<TChild = PortableTextSpan | PortableTextObject> { _type: string _key: string children: TChild[] markDefs?: PortableTextObject[] listItem?: string style?: string l...
2,336
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/reference/asserters.ts
import {isObject} from '../helpers' import type {Reference} from './types' /** @internal */ export function isReference(reference: unknown): reference is Reference { return isObject(reference) && typeof reference._ref === 'string' }
2,337
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/reference/index.ts
export * from './asserters' export * from './types'
2,338
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/reference/types.ts
import type {SanityClient} from '@sanity/client' import type {Path} from '../paths' import type {SanityDocument} from '../documents' /** @public */ export interface Reference { _type: string _ref: string _key?: string _weak?: boolean _strengthenOnPublish?: { type: string weak?: boolean template?:...
2,339
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/asserters.ts
import type {CrossDatasetReferenceSchemaType} from '../crossDatasetReference' import type {TitledListValue} from './definition' import type { ArraySchemaType, BlockChildrenObjectField, BlockListObjectField, BlockSchemaType, BlockStyleObjectField, BooleanSchemaType, NumberSchemaType, ObjectSchemaType, ...
2,340
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/define.ts
import type { DefineArrayMemberBase, DefineSchemaOptions, DefineSchemaBase, MaybeAllowUnknownProps, NarrowPreview, StrictDefinition, WidenInitialValue, WidenValidation, } from './defineTypes' import type {FieldDefinitionBase, IntrinsicTypeName} from './definition' /** * Helper function for defining a ...
2,341
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/defineTypes.ts
import type { ArrayOfEntry, IntrinsicDefinitions, TypeAliasDefinition, IntrinsicTypeName, } from './definition' import type {PreviewConfig} from './preview' import type {InitialValueProperty, SchemaValidationValue} from './types' /** @beta */ export interface DefineSchemaOptions< TStrict extends StrictDefini...
2,342
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/index.ts
export * from './asserters' export * from './defineTypes' export * from './definition' export * from './preview' export * from './ruleBuilder' export * from './types'
2,343
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/preview.ts
import type {ElementType, ReactNode} from 'react' import type {SortOrdering} from './types' /** @public */ export interface PrepareViewOptions { /** @beta */ ordering?: SortOrdering } /** @public */ export interface PreviewValue { title?: string subtitle?: string description?: string media?: ReactNode | E...
2,344
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/ruleBuilder.ts
import type {CustomValidator, FieldReference} from '../validation' /** @public */ export interface RuleDef<T, FieldValue = unknown> { required: () => T // this generic allows callees to provide a type override custom: <LenientFieldValue extends FieldValue>( fn: CustomValidator<LenientFieldValue | undefined>...
2,345
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/types.ts
import type {ComponentType} from 'react' import type {SanityClient} from '@sanity/client' import type {Rule} from '../validation' import type {SanityDocument} from '../documents' import type {CurrentUser} from '../user' import type {PreviewConfig} from './preview' import type {SchemaTypeDefinition} from './definition/s...
2,346
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/index.ts
export * from './type' export * from './schemaDefinition'
2,347
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/schemaDefinition.ts
import type {ComponentType, ReactNode} from 'react' import type {PreviewConfig} from '../preview' import type {InitialValueProperty, SchemaValidationValue} from '../types' import type { ArrayDefinition, BlockDefinition, BooleanDefinition, CrossDatasetReferenceDefinition, DateDefinition, DatetimeDefinition, ...
2,348
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/array.ts
import type {FieldReference} from '../../../validation' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty, SchemaValidationValue} from '../../types' import type { IntrinsicDefinitions, TypeAliasDefinition, IntrinsicTypeName, } from '../schemaDefinition' import typ...
2,349
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/block.ts
import type {ComponentType, ReactNode} from 'react' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {ArrayOfType} from './array' import type {BaseSchemaDefinition} from './common' import type {ObjectDefinition} from './object' /** * S...
2,350
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/boolean.ts
import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' /** @public */ export interface BooleanOptions { layout?: 'switch' | 'checkbox' } /** @public */ // eslint-disable-next-line @typescript-eslint/n...
2,351
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/common.ts
import type {ComponentType, ReactElement, ReactNode} from 'react' import type {ConditionalProperty} from '../../types' import type {ObjectOptions} from './object' /** @public */ export type FieldsetDefinition = { name: string title?: string description?: string group?: string hidden?: ConditionalProperty r...
2,352
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/crossDatasetReference.ts
import type {ComponentType} from 'react' import type {PreviewConfig} from '../../preview' import type {BaseSchemaDefinition} from './common' import type {ReferenceOptions} from './reference' /** @public */ export interface CrossDatasetReferenceDefinition extends BaseSchemaDefinition { type: 'crossDatasetReference' ...
2,353
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/date.ts
import type {FieldReference} from '../../../validation' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' /** @public */ export interface DateOptions { dateFormat?: string } /** @public */ export...
2,354
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/datetime.ts
import type {FieldReference} from '../../../validation' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' /** @public */ export interface DatetimeOptions { dateFormat?: string timeFormat?: strin...
2,355
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/document.ts
import type {SanityDocument} from '../../../documents/types' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty, SortOrdering} from '../../types' import type {ObjectDefinition} from './object' /** * This exists only to allow for extensions using declaration-merging. *...
2,356
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/email.ts
import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' /** @public */ // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface EmailRule extends RuleDef<EmailRule, string> {} /...
2,357
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/file.ts
import type {AssetSource} from '../../../assets' import type {Reference} from '../../../reference' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {ObjectDefinition, ObjectOptions} from './object' /** @public */ export interface FileOp...
2,358
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/geopoint.ts
import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' /** * Geographical point representing a pair of latitude and longitude coordinates, * stored as degrees, in the World Geodetic System 1984 (WGS 84...
2,359
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/image.ts
import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {FieldDefinition} from '../schemaDefinition' import type {ImageCrop, ImageHotspot} from '../../../assets' import type {FileOptions, FileValue} from './file' import type {ObjectDefinition} ...
2,360
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/index.ts
export * from './array' export * from './block' export * from './boolean' export * from './crossDatasetReference' export * from './date' export * from './datetime' export * from './document' export * from './file' export * from './geopoint' export * from './image' export * from './number' export * from './object' expor...
2,361
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/number.ts
import type {FieldReference} from '../../../validation' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition, EnumListProps} from './common' /** @public */ // eslint-disable-next-line @typescript-eslint/no-empty-interf...
2,362
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/object.ts
import type {PreviewConfig} from '../../preview' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {FieldDefinition} from '../schemaDefinition' import type {BaseSchemaDefinition, FieldGroupDefinition, FieldsetDefinition} from './common' ...
2,363
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/reference.ts
import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {SchemaTypeDefinition, TypeReference} from '../schemaDefinition' import type {Reference, ReferenceBaseOptions, ReferenceFilterOptions} from '../../../reference' import type {BaseSchemaDefi...
2,364
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/slug.ts
import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {Path} from '../../../paths' import type {SlugifierFn, SlugSourceFn} from '../../../slug' import type {SlugIsUniqueValidator} from '../../../validation' import type {BaseSchemaDefinition} ...
2,365
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/string.ts
import type {FieldReference} from '../../../validation' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition, EnumListProps} from './common' /** @public */ // eslint-disable-next-line @typescript-eslint/no-empty-interf...
2,366
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/text.ts
import type {ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' import type {StringOptions, StringRule} from './string' /** @public */ // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Tex...
2,367
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/definition/type/url.ts
import type {UriValidationOptions} from '../../../validation/types' import type {RuleDef, ValidationBuilder} from '../../ruleBuilder' import type {InitialValueProperty} from '../../types' import type {BaseSchemaDefinition} from './common' /** @public */ export interface UrlRule extends RuleDef<UrlRule, string> { uri...
2,368
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/alias.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {ArrayOptions, ObjectOptions, StringOptions, TypeAliasDefinition} from '../definition' import {defineArrayMemb...
2,369
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/array.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {ArrayDefinition, BooleanDefinition} from '../definition' import {defineArrayMember, defineField, defineType} ...
2,370
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/block.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {BlockDefinition, BooleanDefinition} from '../definition' import {defineArrayMember, defineField, defineType} ...
2,371
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/boolean.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {BooleanDefinition} from '../definition' import {defineType} from '../types' describe('boolean types', () => ...
2,372
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/date.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {DateDefinition, StringDefinition} from '../definition' import {defineField, defineType} from '../types' desc...
2,373
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/datetime.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {DatetimeDefinition} from '../definition' import {defineField, defineType} from '../types' describe('datetime...
2,374
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/document.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {DocumentDefinition, StringDefinition} from '../definition' import {defineArrayMember, defineField, defineType...
2,375
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/email.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ import type {BooleanDefinition, EmailDefinition} from '../definition' import {defineType} from '../types' describe('email types', () => { describe('defineType', () => { it('should define email schema', () => { const emailDef = defineType({ type...
2,376
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/file.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {FileDefinition, StringDefinition} from '_self_' import {defineField, defineType} from '../types' describe('f...
2,377
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/generic.test.tsx
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import React from 'react' import {defineArrayMember, defineField, defineType} from '../types' describe('common type test'...
2,378
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/geopoint.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {GeopointDefinition, StringDefinition} from '../definition' import {defineType, Schema} from '../types' descr...
2,379
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/image.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {ImageDefinition} from '../definition' import {defineField, defineType, Schema} from '../types' describe('ima...
2,380
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/number.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {NumberDefinition, StringDefinition} from '../definition' import {defineField, defineType} from '../types' de...
2,381
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/object.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {ObjectDefinition, StringDefinition} from '../definition' import {defineField, defineType} from '../types' de...
2,382
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/reference.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {BooleanDefinition, ReferenceDefinition} from '../definition' import {defineType} from '../types' describe('r...
2,383
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/slug.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {SlugDefinition, StringDefinition} from '../definition' import {defineType} from '../types' describe('slug ty...
2,384
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/string.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type { BooleanDefinition, FieldDefinition, FieldDefinitionBase, StringDefinition, } from '../definition' im...
2,385
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/text.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {BooleanDefinition, TextDefinition} from '../definition' import {defineType} from '../types' describe('text t...
2,386
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/typeMerge.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ import {ExtensionTypeExampleDef, ObjectDefinition} from '../definition' import {defineType, Schema as S} from '../types' declare module '../definition' { // here we type up our custom schema definition export type ExtensionTypeExampleDef = Omit<ObjectDefinitio...
2,387
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/schema/test/url.test.ts
/* eslint-disable @typescript-eslint/no-unused-vars */ /** * Some of these tests have no expect statement; * use of ts-expect-error serves the same purpose - TypeScript is the testrunner here */ import type {BooleanDefinition, UrlDefinition} from '../definition' import {defineType} from '../types' describe('url typ...
2,388
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/slug/asserters.ts
import {isObject} from '../helpers' import type {Slug} from './types' /** * Checks whether the given `thing` is a slug, eg an object with a `current` string property. * * @param thing - The thing to check * @returns True if slug, false otherwise * @public */ export function isSlug(thing: unknown): thing is Slug ...
2,389
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/slug/index.ts
export * from './types' export * from './asserters'
2,390
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/slug/types.ts
import type {SanityClient} from '@sanity/client' import type {SlugSchemaType, Schema} from '../schema' import type {SanityDocument} from '../documents' import type {Path} from '../paths' import type {CurrentUser} from '../user' /** * A slug object, currently holding a `current` property * * In the future, this may ...
2,391
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/transactionLog/asserters.ts
import type {Mutation} from '../mutations' import type {CreateSquashedMutation, TransactionLogMutation} from './types' /** @internal */ export function isCreateSquashedMutation( mutation: Mutation | TransactionLogMutation, ): mutation is CreateSquashedMutation { return 'createSquashed' in mutation }
2,392
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/transactionLog/index.ts
export * from './types' export * from './asserters'
2,393
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/transactionLog/types.ts
import type {Mutation} from '../mutations' /** * An entry in the transaction log * * @internal */ export interface TransactionLogEvent { /** * ID of transaction */ id: string /** * ISO-formatted timestamp (zulu-time) of when the transaction happened */ timestamp: string /** * User ID of ...
2,394
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/upload/index.ts
export * from './uploadState'
2,395
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/upload/uploadState.ts
/** @internal */ export interface UploadState { progress: number /** @deprecated use createdAt instead */ initiated?: string /** @deprecated use updatedAt instead */ updated?: string createdAt: string updatedAt: string file: {name: string; type: string} previewImage?: string }
2,396
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/user/index.ts
export * from './types'
2,397
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/user/types.ts
/** @public */ export interface Role { name: string title: string description?: string } /** @public */ export interface CurrentUser { id: string name: string email: string profileImage?: string provider?: string /** @deprecated use `roles` instead */ role: string roles: Role[] } /** @public */ ...
2,398
0
petrpan-code/sanity-io/sanity/packages/@sanity/types/src
petrpan-code/sanity-io/sanity/packages/@sanity/types/src/validation/asserters.ts
import type {FormNodeValidation} from './types' /** @internal */ export function isValidationError( node: FormNodeValidation, ): node is FormNodeValidation & {level: 'error'} { return node.level === 'error' } /** @internal */ export function isValidationWarning( node: FormNodeValidation, ): node is FormNodeVali...
2,399