@sanity/types
Advanced tools
Comparing version 2.2.6 to 2.3.5-canary.17
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import { Reference } from '../reference'; | ||
@@ -86,8 +85,20 @@ import { SanityDocument } from '../documents'; | ||
} | ||
export declare type AssetFromSource = { | ||
kind: 'assetDocumentId' | 'file' | 'base64' | 'url'; | ||
value: string | File; | ||
assetDocumentProps?: ImageAsset; | ||
}; | ||
export interface AssetSourceComponentProps { | ||
document: SanityDocument; | ||
selectedAssets: Asset[]; | ||
selectionType: 'single' | 'multiple'; | ||
onClose: () => void; | ||
onSelect: (assetFromSource: AssetFromSource) => void; | ||
} | ||
export interface AssetSource { | ||
name: string; | ||
title: string; | ||
component: React.ComponentType; | ||
icon?: React.ComponentType; | ||
component: React.ComponentType<AssetSourceComponentProps>; | ||
icon?: React.ComponentType<void>; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -19,3 +19,3 @@ "use strict"; | ||
function isTitledListValue(item) { | ||
return typeof item === 'object' && item !== null && 'title' in item && 'value' in item; | ||
return typeof item === 'object' && item !== null && 'title' in item && 'value' in item && Object.keys(item).length === 2; | ||
} |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import { ReferenceOptions } from '../reference'; | ||
@@ -3,0 +2,0 @@ import { AssetSource } from '../assets'; |
{ | ||
"name": "@sanity/types", | ||
"version": "2.2.6", | ||
"version": "2.3.5-canary.17+a910496797", | ||
"description": "Type definitions for common Sanity data structures", | ||
@@ -37,3 +37,3 @@ "main": "lib/index.js", | ||
"homepage": "https://www.sanity.io/", | ||
"gitHead": "bb09b0cc911039f5b3a1c9bf5fb8eda520d411f6" | ||
"gitHead": "a91049679784fd6b7369c4c66640decd6b31296c" | ||
} |
@@ -195,11 +195,2 @@ /// <reference types="react" /> | ||
} | ||
declare module 'part:@sanity/components/scroll' { | ||
export { | ||
ScrollContainer, | ||
ScrollMonitor, | ||
ScrollContextValue, | ||
ScrollEventHandler, | ||
useOnScroll, | ||
} from './build-snapshot/__legacy/@sanity/components/scroll' | ||
} | ||
declare module 'part:@sanity/components/selects/custom' { | ||
@@ -206,0 +197,0 @@ export {default} from './build-snapshot/__legacy/@sanity/components/selects/CustomSelect' |
@@ -108,7 +108,21 @@ import {Reference} from '../reference' | ||
export type AssetFromSource = { | ||
kind: 'assetDocumentId' | 'file' | 'base64' | 'url' | ||
value: string | File | ||
assetDocumentProps?: ImageAsset | ||
} | ||
export interface AssetSourceComponentProps { | ||
document: SanityDocument | ||
selectedAssets: Asset[] | ||
selectionType: 'single' | 'multiple' | ||
onClose: () => void | ||
onSelect: (assetFromSource: AssetFromSource) => void | ||
} | ||
export interface AssetSource { | ||
name: string | ||
title: string | ||
component: React.ComponentType | ||
icon?: React.ComponentType | ||
component: React.ComponentType<AssetSourceComponentProps> | ||
icon?: React.ComponentType<void> | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
417770
14271
1