@stackbit/types
Advanced tools
Comparing version 0.1.14 to 0.2.0-alpha.0
@@ -41,7 +41,7 @@ import type { FieldType } from './model-fields'; | ||
}; | ||
export declare type DocumentField = DocumentValueField | DocumentObjectField | DocumentModelField | DocumentReferenceField | DocumentListField | DocumentRichTextField | DocumentImageField; | ||
export declare type DocumentFieldLocalized = DocumentValueFieldLocalized | DocumentObjectFieldLocalized | DocumentModelFieldLocalized | DocumentReferenceFieldLocalized | DocumentListFieldLocalized | DocumentRichTextFieldLocalized | DocumentImageFieldLocalized; | ||
export declare type DocumentFieldNonLocalized = DocumentValueFieldNonLocalized | DocumentObjectFieldNonLocalized | DocumentModelFieldNonLocalized | DocumentReferenceFieldNonLocalized | DocumentListFieldNonLocalized | DocumentRichTextFieldNonLocalized | DocumentImageFieldNonLocalized; | ||
export declare type DocumentFieldBaseProps = DocumentValueFieldBaseProps | DocumentObjectFieldBase | DocumentModelFieldBase | DocumentReferenceFieldBase | DocumentListFieldBase | DocumentRichTextFieldBase | DocumentImageFieldBase; | ||
export declare type DocumentFieldSpecificProps = DocumentValueFieldProps | DocumentObjectFieldProps | DocumentModelFieldProps | DocumentReferenceFieldProps | DocumentListFieldProps | DocumentRichTextFieldProps | DocumentImageFieldProps; | ||
export declare type DocumentField = DocumentValueField | DocumentObjectField | DocumentModelField | DocumentReferenceField | DocumentCrossReferenceField | DocumentListField | DocumentRichTextField | DocumentImageField; | ||
export declare type DocumentFieldLocalized = DocumentValueFieldLocalized | DocumentObjectFieldLocalized | DocumentModelFieldLocalized | DocumentReferenceFieldLocalized | DocumentCrossReferenceFieldLocalized | DocumentListFieldLocalized | DocumentRichTextFieldLocalized | DocumentImageFieldLocalized; | ||
export declare type DocumentFieldNonLocalized = DocumentValueFieldNonLocalized | DocumentObjectFieldNonLocalized | DocumentModelFieldNonLocalized | DocumentReferenceFieldNonLocalized | DocumentCrossReferenceFieldNonLocalized | DocumentListFieldNonLocalized | DocumentRichTextFieldNonLocalized | DocumentImageFieldNonLocalized; | ||
export declare type DocumentFieldBaseProps = DocumentValueFieldBaseProps | DocumentObjectFieldBase | DocumentModelFieldBase | DocumentReferenceFieldBase | DocumentCrossReferenceFieldBase | DocumentListFieldBase | DocumentRichTextFieldBase | DocumentImageFieldBase; | ||
export declare type DocumentFieldSpecificProps = DocumentValueFieldProps | DocumentObjectFieldProps | DocumentModelFieldProps | DocumentReferenceFieldProps | DocumentCrossReferenceFieldProps | DocumentListFieldProps | DocumentRichTextFieldProps | DocumentImageFieldProps; | ||
declare type FindByType<Union extends { | ||
@@ -66,3 +66,3 @@ type: FieldType; | ||
}>; | ||
export declare type DocumentValueFieldType = Exclude<FieldType, 'object' | 'model' | 'reference' | 'richText' | 'list' | 'image'>; | ||
export declare type DocumentValueFieldType = Exclude<FieldType, 'object' | 'model' | 'reference' | 'cross-reference' | 'richText' | 'list' | 'image'>; | ||
/** | ||
@@ -124,2 +124,17 @@ * Document field with any type except 'object' | 'model' | 'reference' | 'richText' | 'list' | ||
/** | ||
* Document "cross-reference" field | ||
*/ | ||
export declare type DocumentCrossReferenceField = DocumentCrossReferenceFieldLocalized | DocumentCrossReferenceFieldNonLocalized; | ||
export declare type DocumentCrossReferenceFieldLocalized = DocumentFieldTypeLocalized<DocumentCrossReferenceFieldBase, DocumentCrossReferenceFieldProps>; | ||
export declare type DocumentCrossReferenceFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentCrossReferenceFieldBase, DocumentCrossReferenceFieldProps>; | ||
export declare type DocumentCrossReferenceFieldBase = { | ||
type: 'cross-reference'; | ||
refType: 'document' | 'asset'; | ||
}; | ||
export declare type DocumentCrossReferenceFieldProps = { | ||
refId: string; | ||
refSrcType: string; | ||
refProjectId: string; | ||
}; | ||
/** | ||
* Document "richText" field | ||
@@ -126,0 +141,0 @@ */ |
@@ -70,3 +70,3 @@ /** | ||
} | ||
export declare type FieldEnumProps = FieldEnumDropdownProps | FieldEnumThumbnailsProps | FieldEnumPaletteProps; | ||
export declare type FieldEnumProps = FieldEnumDropdownProps | FieldEnumThumbnailsProps | FieldEnumPaletteProps | FieldEnumPaletteColorsProps; | ||
export interface FieldEnumDropdownProps { | ||
@@ -87,2 +87,7 @@ type: 'enum'; | ||
} | ||
export interface FieldEnumPaletteColorsProps { | ||
type: 'enum'; | ||
controlType: 'palette-colors'; | ||
options: FieldEnumOptionPaletteColors[]; | ||
} | ||
export declare type FieldEnumOptionValue = string | number; | ||
@@ -94,3 +99,3 @@ export interface FieldEnumOptionObject { | ||
export interface FieldEnumOptionThumbnails extends FieldEnumOptionObject { | ||
thumbnail?: string; | ||
thumbnail: string; | ||
} | ||
@@ -102,2 +107,5 @@ export interface FieldEnumOptionPalette extends FieldEnumOptionObject { | ||
} | ||
export interface FieldEnumOptionPaletteColors extends FieldEnumOptionObject { | ||
colors: string[]; | ||
} | ||
export interface FieldImageProps { | ||
@@ -104,0 +112,0 @@ type: 'image'; |
{ | ||
"name": "@stackbit/types", | ||
"version": "0.1.14", | ||
"version": "0.2.0-alpha.0", | ||
"description": "Types for Stackbit config and Content Source Interface", | ||
@@ -42,3 +42,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "f4471bdd3fb6fc3c6950a9899ce627fa921310cd" | ||
"gitHead": "65c13454379b9cba8a9ce7667f0b15e1f863f1fa" | ||
} |
@@ -50,2 +50,3 @@ import type { FieldType } from './model-fields'; | ||
| DocumentReferenceField | ||
| DocumentCrossReferenceField | ||
| DocumentListField | ||
@@ -60,2 +61,3 @@ | DocumentRichTextField | ||
| DocumentReferenceFieldLocalized | ||
| DocumentCrossReferenceFieldLocalized | ||
| DocumentListFieldLocalized | ||
@@ -70,2 +72,3 @@ | DocumentRichTextFieldLocalized | ||
| DocumentReferenceFieldNonLocalized | ||
| DocumentCrossReferenceFieldNonLocalized | ||
| DocumentListFieldNonLocalized | ||
@@ -80,2 +83,3 @@ | DocumentRichTextFieldNonLocalized | ||
| DocumentReferenceFieldBase | ||
| DocumentCrossReferenceFieldBase | ||
| DocumentListFieldBase | ||
@@ -90,2 +94,3 @@ | DocumentRichTextFieldBase | ||
| DocumentReferenceFieldProps | ||
| DocumentCrossReferenceFieldProps | ||
| DocumentListFieldProps | ||
@@ -123,3 +128,3 @@ | DocumentRichTextFieldProps | ||
FieldType, | ||
'object' | 'model' | 'reference' | 'richText' | 'list' | 'image' | ||
'object' | 'model' | 'reference' | 'cross-reference' | 'richText' | 'list' | 'image' | ||
>; | ||
@@ -213,2 +218,26 @@ | ||
/** | ||
* Document "cross-reference" field | ||
*/ | ||
export type DocumentCrossReferenceField = | ||
| DocumentCrossReferenceFieldLocalized | ||
| DocumentCrossReferenceFieldNonLocalized; | ||
export type DocumentCrossReferenceFieldLocalized = DocumentFieldTypeLocalized< | ||
DocumentCrossReferenceFieldBase, | ||
DocumentCrossReferenceFieldProps | ||
>; | ||
export type DocumentCrossReferenceFieldNonLocalized = DocumentFieldTypeNonLocalized< | ||
DocumentCrossReferenceFieldBase, | ||
DocumentCrossReferenceFieldProps | ||
>; | ||
export type DocumentCrossReferenceFieldBase = { | ||
type: 'cross-reference'; | ||
refType: 'document' | 'asset'; | ||
}; | ||
export type DocumentCrossReferenceFieldProps = { | ||
refId: string; | ||
refSrcType: string; | ||
refProjectId: string; | ||
}; | ||
/** | ||
* Document "richText" field | ||
@@ -215,0 +244,0 @@ */ |
@@ -111,3 +111,3 @@ /** | ||
export type FieldEnumProps = FieldEnumDropdownProps | FieldEnumThumbnailsProps | FieldEnumPaletteProps; | ||
export type FieldEnumProps = FieldEnumDropdownProps | FieldEnumThumbnailsProps | FieldEnumPaletteProps | FieldEnumPaletteColorsProps; | ||
@@ -132,2 +132,8 @@ export interface FieldEnumDropdownProps { | ||
export interface FieldEnumPaletteColorsProps { | ||
type: 'enum'; | ||
controlType: 'palette-colors'; | ||
options: FieldEnumOptionPaletteColors[]; | ||
} | ||
export type FieldEnumOptionValue = string | number; | ||
@@ -141,3 +147,3 @@ | ||
export interface FieldEnumOptionThumbnails extends FieldEnumOptionObject { | ||
thumbnail?: string; | ||
thumbnail: string; | ||
} | ||
@@ -151,2 +157,6 @@ | ||
export interface FieldEnumOptionPaletteColors extends FieldEnumOptionObject { | ||
colors: string[]; | ||
} | ||
export interface FieldImageProps { | ||
@@ -153,0 +163,0 @@ type: 'image'; |
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
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
127262
62
2535