Socket
Socket
Sign inDemoInstall

@sanity/types

Package Overview
Dependencies
Maintainers
23
Versions
897
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.14.1-canary.36 to 2.14.1-conditional-fields.64

dist/dts/user/index.d.ts

1

dist/dts/index.d.ts

@@ -12,2 +12,3 @@ export * from './slug';

export * from './images';
export * from './user';
//# sourceMappingURL=index.d.ts.map

18

dist/dts/schema/types.d.ts

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

import { SlugOptions } from '../slug';
import { SanityDocument } from '../documents';
import { CurrentUser } from '../user';
export interface Schema {

@@ -29,2 +31,10 @@ name: string;

};
export interface HiddenOptionCallbackContext {
parent?: Record<string, unknown>;
document: SanityDocument;
currentUser: Omit<CurrentUser, 'role'>;
value: unknown;
}
export declare type HiddenOption = boolean | HiddenOptionCallback;
export declare type HiddenOptionCallback = (context: HiddenOptionCallbackContext) => boolean;
export declare type InitialValueParams = Record<string, unknown>;

@@ -43,3 +53,2 @@ export declare type InitialValueResolver<T> = (params?: InitialValueParams) => Promise<T> | T;

options?: unknown;
hidden?: boolean;
preview?: {

@@ -115,8 +124,9 @@ select?: PreviewValue;

}
export declare type ObjectFieldType<T extends SchemaType = SchemaType> = T & {
hidden?: HiddenOption;
};
export interface ObjectField<T extends SchemaType = SchemaType> {
name: string;
fieldset?: string;
type: T & {
hidden?: boolean;
};
type: ObjectFieldType<T>;
}

@@ -123,0 +133,0 @@ export interface ObjectSchemaType extends BaseSchemaType {

@@ -148,2 +148,15 @@ "use strict";

});
});
var _user = require("./user");
Object.keys(_user).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _user[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _user[key];
}
});
});
{
"name": "@sanity/types",
"version": "2.14.1-canary.36+e74126bdd6",
"version": "2.14.1-conditional-fields.64+9588d94d86",
"description": "Type definitions for common Sanity data structures",

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

"dependencies": {
"@sanity/client": "2.14.1-canary.36+e74126bdd6",
"@sanity/client": "2.14.1-conditional-fields.64+9588d94d86",
"@sanity/color": "^2.1.4",
"@sanity/types": "2.14.1-canary.36+e74126bdd6",
"@sanity/types": "2.14.1-conditional-fields.64+9588d94d86",
"@types/react": "^17.0.0",

@@ -43,3 +43,3 @@ "react": "17.0.1",

"homepage": "https://www.sanity.io/",
"gitHead": "e74126bdd6f95d98aae8032eb078edb082ce593b"
"gitHead": "9588d94d8697a535026272767681a1cdfefb1f4c"
}

@@ -12,1 +12,2 @@ export * from './slug'

export * from './images'
export * from './user'

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

import {SlugOptions} from '../slug'
import {SanityDocument} from '../documents'
import {CurrentUser} from '../user'

@@ -35,2 +37,12 @@ export interface Schema {

export interface HiddenOptionCallbackContext {
parent?: Record<string, unknown>
document: SanityDocument
currentUser: Omit<CurrentUser, 'role'>
value: unknown
}
export type HiddenOption = boolean | HiddenOptionCallback
export type HiddenOptionCallback = (context: HiddenOptionCallbackContext) => boolean
export type InitialValueParams = Record<string, unknown>

@@ -50,3 +62,2 @@ export type InitialValueResolver<T> = (params?: InitialValueParams) => Promise<T> | T

options?: unknown
hidden?: boolean

@@ -139,6 +150,8 @@ preview?: {

export type ObjectFieldType<T extends SchemaType = SchemaType> = T & {hidden?: HiddenOption}
export interface ObjectField<T extends SchemaType = SchemaType> {
name: string
fieldset?: string
type: T & {hidden?: boolean}
type: ObjectFieldType<T>
}

@@ -145,0 +158,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