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 to 2.10.0

3

lib/schema/asserters.d.ts

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

import { ObjectSchemaType, ReferenceSchemaType, SchemaType, TitledListValue } from './types';
import { ArraySchemaType, 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,2 +7,3 @@ "use strict";

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

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

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

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

@@ -28,2 +28,5 @@ 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 {

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

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

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

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

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

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

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

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

@@ -122,0 +127,0 @@ path: string;

{
"name": "@sanity/types",
"version": "2.9.1",
"version": "2.10.0",
"description": "Type definitions for common Sanity data structures",

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

"@sanity/client": "2.8.0",
"@sanity/color": "^2.0.15",
"@types/react": "^17.0.0",

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

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

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

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

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

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

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

@@ -34,2 +34,6 @@ // 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 {

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

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

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

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

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

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

@@ -143,3 +149,3 @@

fieldsets?: Fieldset[]
initialValue?: ((arg?: any) => Promise<any> | any) | any | undefined
initialValue?: InitialValueProperty<Record<string, unknown>>

@@ -146,0 +152,0 @@ // Experimentals

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