Socket
Socket
Sign inDemoInstall

@sanity/types

Package Overview
Dependencies
Maintainers
24
Versions
912
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/types - npm Package Compare versions

Comparing version 2.9.1-canary.15 to 2.9.1

3

lib/schema/asserters.d.ts

@@ -1,6 +0,5 @@

import { ArraySchemaType, ObjectSchemaType, ReferenceSchemaType, SchemaType, TitledListValue } from './types';
import { ObjectSchemaType, ReferenceSchemaType, SchemaType, TitledListValue } from './types';
export declare function isObjectSchemaType(type: SchemaType): type is ObjectSchemaType;
export declare function isArraySchemaType(type: SchemaType): type is ArraySchemaType;
export declare function isReferenceSchemaType(type: SchemaType | ReferenceSchemaType): type is ReferenceSchemaType;
export declare function isTitledListValue(item: unknown): item is TitledListValue;
//# sourceMappingURL=asserters.d.ts.map

@@ -7,3 +7,2 @@ "use strict";

exports.isObjectSchemaType = isObjectSchemaType;
exports.isArraySchemaType = isArraySchemaType;
exports.isReferenceSchemaType = isReferenceSchemaType;

@@ -16,6 +15,2 @@ exports.isTitledListValue = isTitledListValue;

function isArraySchemaType(type) {
return type.jsonType === 'array';
}
function isReferenceSchemaType(type) {

@@ -22,0 +17,0 @@ return type.jsonType === 'object' && 'to' in type && Array.isArray(type.to);

@@ -28,5 +28,2 @@ import React from 'react';

};
export declare type InitialValueParams = Record<string, unknown>;
export declare type InitialValueResolver<T> = (params?: InitialValueParams) => Promise<T> | T;
export declare type InitialValueProperty<T = unknown> = T | InitialValueResolver<T> | undefined;
export interface BaseSchemaType {

@@ -40,4 +37,2 @@ name: string;

icon?: React.ComponentType;
initialValue?: InitialValueProperty;
options?: unknown;
preview?: {

@@ -81,3 +76,3 @@ select?: PreviewValue;

options?: EnumListProps<number>;
initialValue?: InitialValueProperty<number>;
initialValue?: ((arg?: any) => Promise<number> | number) | number | undefined;
}

@@ -89,3 +84,3 @@ export interface BooleanSchemaType extends BaseSchemaType {

};
initialValue?: InitialValueProperty<boolean>;
initialValue?: ((arg?: any) => Promise<boolean> | boolean) | boolean | undefined;
}

@@ -124,7 +119,6 @@ export interface ArraySchemaType<V = unknown> extends BaseSchemaType {

fieldsets?: Fieldset[];
initialValue?: InitialValueProperty<Record<string, unknown>>;
initialValue?: ((arg?: any) => Promise<any> | any) | any | undefined;
__experimental_search?: {
path: string;
weight: number;
mapWith?: string;
}[];

@@ -131,0 +125,0 @@ }

{
"name": "@sanity/types",
"version": "2.9.1-canary.15+5c3d3c70f2",
"version": "2.9.1",
"description": "Type definitions for common Sanity data structures",

@@ -23,3 +23,3 @@ "main": "lib/index.js",

"dependencies": {
"@sanity/client": "2.9.1-canary.15+5c3d3c70f2",
"@sanity/client": "2.8.0",
"@types/react": "^17.0.0",

@@ -40,3 +40,3 @@ "rxjs": "^6.5.3"

"homepage": "https://www.sanity.io/",
"gitHead": "5c3d3c70f22154230f33085c8f8fdfdbde064b7e"
"gitHead": "a7413acbf9d7bab39f62e89bad9f2979d347cfe4"
}

@@ -1,8 +0,2 @@

import {
ArraySchemaType,
ObjectSchemaType,
ReferenceSchemaType,
SchemaType,
TitledListValue,
} from './types'
import {ObjectSchemaType, ReferenceSchemaType, SchemaType, TitledListValue} from './types'

@@ -13,6 +7,2 @@ export function isObjectSchemaType(type: SchemaType): type is ObjectSchemaType {

export function isArraySchemaType(type: SchemaType): type is ArraySchemaType {
return type.jsonType === 'array'
}
export function isReferenceSchemaType(

@@ -19,0 +9,0 @@ type: SchemaType | ReferenceSchemaType

@@ -34,6 +34,2 @@ // Note: INCOMPLETE, but it's a start

export type InitialValueParams = Record<string, unknown>
export type InitialValueResolver<T> = (params?: InitialValueParams) => Promise<T> | T
export type InitialValueProperty<T = unknown> = T | InitialValueResolver<T> | undefined
export interface BaseSchemaType {

@@ -47,4 +43,2 @@ name: string

icon?: React.ComponentType
initialValue?: InitialValueProperty
options?: unknown

@@ -99,3 +93,3 @@ preview?: {

options?: EnumListProps<number>
initialValue?: InitialValueProperty<number>
initialValue?: ((arg?: any) => Promise<number> | number) | number | undefined
}

@@ -108,3 +102,3 @@

}
initialValue?: InitialValueProperty<boolean>
initialValue?: ((arg?: any) => Promise<boolean> | boolean) | boolean | undefined
}

@@ -149,7 +143,7 @@

fieldsets?: Fieldset[]
initialValue?: InitialValueProperty<Record<string, unknown>>
initialValue?: ((arg?: any) => Promise<any> | any) | any | undefined
// Experimentals
/* eslint-disable camelcase */
__experimental_search?: {path: string; weight: number; mapWith?: string}[]
__experimental_search?: {path: string; weight: number}[]
/* eslint-enable camelcase */

@@ -156,0 +150,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc