Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stackbit/types

Package Overview
Dependencies
Maintainers
13
Versions
305
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackbit/types - npm Package Compare versions

Comparing version 0.1.6-locale.0 to 0.1.6-locale.1

31

dist/config.d.ts

@@ -6,2 +6,3 @@ import type { ContentSourceInterface } from './content-source';

import { SidebarButton } from './sidebar-button';
import { Field, FieldListItems } from './model-fields';
export interface StackbitConfig {

@@ -63,2 +64,3 @@ /**

}) => DocumentWithSource[];
modelExtensions?: ModelExtension[];
/** @deprecated */

@@ -160,2 +162,31 @@ models?: NamelessModelMap;

export declare type DistributeNamelessModels<Type extends Model> = Type extends Model ? Omit<Type, 'name'> : never;
export declare type DistributeFieldsExtension<Type extends Field> = Type extends {
type: 'object';
} ? Partial<Omit<Type, 'name' | 'fields'>> & {
name: string;
fields?: DistributeFieldsExtension<Field>[];
} : Type extends {
type: 'list';
} ? Partial<Omit<Type, 'name' | 'items'>> & {
name: string;
items?: DistributePartialListItems<FieldListItems>[];
} : Type extends {
type: 'style';
} ? Type : Partial<Omit<Type, 'name'>> & {
name: string;
};
export declare type DistributePartialListItems<Type extends FieldListItems> = Type extends {
type: 'object';
} ? Partial<Omit<Type, 'fields'>> & {
fields?: DistributeFieldsExtension<Field>[];
} : Partial<Type>;
export declare type FieldExtension = DistributeFieldsExtension<Field>;
export declare type DistributeModelExtensions<Type extends Model> = Type extends Model ? Partial<Omit<Type, 'name' | 'fields'>> & {
name: string;
fields?: FieldExtension[];
} & {
srcType?: string;
srcProjectId?: string;
} : never;
export declare type ModelExtension = DistributeModelExtensions<Model>;
//# sourceMappingURL=config.d.ts.map

1

dist/content-source-document.d.ts

@@ -60,3 +60,2 @@ import type { FieldType } from './model-fields';

localized?: false;
locale?: string;
}>;

@@ -63,0 +62,0 @@ export declare type DocumentValueFieldType = Exclude<FieldType, 'object' | 'model' | 'reference' | 'richText' | 'list' | 'image'>;

{
"name": "@stackbit/types",
"version": "0.1.6-locale.0",
"version": "0.1.6-locale.1",
"description": "Types for Stackbit config and Content Source Interface",

@@ -12,3 +12,3 @@ "main": "dist/index.js",

"scripts": {
"test": "jest --passWithNoTests",
"test": "jest",
"build": "rm -rf dist && tsc",

@@ -43,3 +43,3 @@ "watch": "rm -rf dist && tsc -w",

},
"gitHead": "5ae211b3a7770c097d36efe3b860ed4d4d8a3c25"
"gitHead": "32c6266048418ba8b337b33f01a07d5673160249"
}

@@ -6,2 +6,3 @@ import type { ContentSourceInterface } from './content-source';

import { SidebarButton } from './sidebar-button';
import { Field, FieldListItems } from './model-fields';

@@ -69,2 +70,3 @@ export interface StackbitConfig {

mapDocuments?: (options: { documents: DocumentWithSource[]; models: ModelWithSource[] }) => DocumentWithSource[];
modelExtensions?: ModelExtension[];

@@ -178,1 +180,30 @@ /** @deprecated */

export type DistributeNamelessModels<Type extends Model> = Type extends Model ? Omit<Type, 'name'> : never;
// Make all Field properties except the 'name' optional, including fields of nested objects and lists.
// prettier-ignore
export type DistributeFieldsExtension<Type extends Field> =
Type extends { type: 'object' } ?
Partial<Omit<Type, 'name' | 'fields'>> & { name: string; fields?: DistributeFieldsExtension<Field>[] } :
Type extends { type: 'list' } ?
Partial<Omit<Type, 'name' | 'items'>> & { name: string; items?: DistributePartialListItems<FieldListItems>[] } :
// do not make style fields partial
Type extends { type: 'style' } ? Type :
Partial<Omit<Type, 'name'>> & { name: string };
// prettier-ignore
export type DistributePartialListItems<Type extends FieldListItems> =
Type extends { type: 'object' } ?
Partial<Omit<Type, 'fields'>> & { fields?: DistributeFieldsExtension<Field>[] } :
Partial<Type>;
export type FieldExtension = DistributeFieldsExtension<Field>;
// prettier-ignore
export type DistributeModelExtensions<Type extends Model> =
Type extends Model
? Partial<Omit<Type, 'name' | 'fields'>>
& { name: string; fields?: FieldExtension[] }
& { srcType?: string; srcProjectId?: string; }
: never;
export type ModelExtension = DistributeModelExtensions<Model>;

@@ -110,3 +110,2 @@ import type { FieldType } from './model-fields';

localized?: false;
locale?: string;
}

@@ -113,0 +112,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