@keystatic/core

Search for an npm package

@keystatic/core/ui

module "@keystatic/core/ui" {
export function Keystatic(props: {
config: Config;
appSlug?: {
envName: string;
value: string | undefined;
};
}): import("react").Element
export type Router = {
push: (path: string) => void;
replace: (path: string) => void;
href: string;
params: string[];
pathname: string;
search: string;
}
}
module "@keystatic/core" {
export function config<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}>(config: Config<Collections, Singletons>): Config<Collections, Singletons>
export function collection<Schema extends Record<string, ComponentSchema>, SlugField extends {
[K in keyof Schema]: Schema[K] extends SlugFormField<any, any, any, any> ? K : never;
}[keyof Schema]>(collection: Collection<Schema, SlugField & string> & {
columns?: {
[K in keyof Schema]: Schema[K] extends FormField<any, any, string | number | boolean | Date | null | undefined> | SlugFormField<any, any, any, string> ? K & string : never;
}[keyof Schema][];
}): Collection<Schema, SlugField & string>
export function singleton<Schema extends Record<string, ComponentSchema>>(collection: Singleton<Schema>): Singleton<Schema>
export const BlockWrapper: (props: BlockWrapperProps) => import("react").Element = ...
Unexported symbols referenced here
type BlockWrapperProps = {
attributes?: import("slate-react").RenderElementProps["attributes"];
children: import("react").ReactNode;
draggable?: boolean;
}
Referenced by
  • BlockWrapper
export const NotEditable: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>> = ...
export const ToolbarSeparator: () => import("react").Element = ...
export type CloudConfig<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
} = {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
} = {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = {
cloud: {
project: string;
};
collections?: Collections;
singletons?: Singletons;
} & CommonConfig<Collections, Singletons>
Unexported symbols referenced here
type CloudStorageConfig = {
kind: "cloud";
} & CommonRemoteStorageConfig
Referenced by
type CommonConfig<Collections, Singletons> = {
locale?: Locale;
cloud?: {
project: string;
};
ui?: UserInterface<Collections, Singletons>;
}
Referenced by
type CommonRemoteStorageConfig = {
pathPrefix?: string;
branchPrefix?: string;
}
Referenced by
type Locale = keyof typeof locales
Referenced by
type UserInterface<Collections, Singletons> = {
brand?: {
mark?: BrandMark;
name: string;
};
navigation?: Navigation<(keyof Collections & string) | (keyof Singletons & string) | typeof NAVIGATION_DIVIDER_KEY>;
}
Referenced by
const locales: {
'ar-AE': string;
'bg-BG': string;
'cs-CZ': string;
'da-DK': string;
'de-DE': string;
'el-GR': string;
'en-US': string;
'es-ES': string;
'et-EE': string;
'fi-FI': string;
'fr-FR': string;
'he-IL': string;
'hr-HR': string;
'hu-HU': string;
'it-IT': string;
'ja-JP': string;
'ko-KR': string;
'lt-LT': string;
'lv-LV': string;
'nb-NO': string;
'nl-NL': string;
'pl-PL': string;
'pt-BR': string;
'pt-PT': string;
'ro-RO': string;
'ru-RU': string;
'sk-SK': string;
'sl-SI': string;
'sr-SP': string;
'sv-SE': string;
'tr-TR': string;
'uk-UA': string;
'zh-CN': string;
'zh-TW': string;
} = ...
Referenced by
type BrandMark = (props: {
colorScheme: Exclude<import("@keystar/ui").ColorScheme, "auto">;
}) => import("react").ReactElement
Referenced by
type Navigation<K> = K[] | {
[key: string]: K[];
}
Referenced by
const NAVIGATION_DIVIDER_KEY: "---" = ...
Referenced by
export type Collection<Schema extends Record<string, ComponentSchema>, SlugField extends string> = {
label: string;
path?: `${string}/${Glob}` | `${string}/${Glob}/${string}`;
entryLayout?: EntryLayout;
format?: Format;
previewUrl?: string;
columns?: string[];
template?: string;
parseSlugForSort?: (slug: string) => string | number;
slugField: SlugField;
schema: Schema;
}
Referenced by
export type Config<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
} = {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
} = {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = {
collections?: Collections;
singletons?: Singletons;
} & ({} extends Collections ? {} : {
collections: Collections;
}) & ({} extends Singletons ? {} : {
singletons: Singletons;
}) & CommonConfig<Collections, Singletons>
Referenced by
Unexported symbols referenced here
type LocalStorageConfig = {
kind: "local";
}
Referenced by
type GitHubStorageConfig = {
kind: "github";
repo: RepoConfig;
} & CommonRemoteStorageConfig
Referenced by
type RepoConfig = `${string}/${string}` | {
owner: string;
name: string;
}
Referenced by
export type DataFormat = "json" | "yaml"
Referenced by
export type EntryLayout = "content" | "form"
Referenced by
export type Format = DataFormat | {
data?: DataFormat;
contentField?: string | [string, ...string[]];
}
Referenced by
export type GitHubConfig<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
} = {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
} = {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = {
collections?: Collections;
singletons?: Singletons;
} & CommonConfig<Collections, Singletons>
export type Glob = "*" | "**"
Referenced by
export type LocalConfig<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
} = {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
} = {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = {
collections?: Collections;
singletons?: Singletons;
} & CommonConfig<Collections, Singletons>
export type Singleton<Schema extends Record<string, ComponentSchema>> = {
label: string;
path?: string;
entryLayout?: EntryLayout;
format?: Format;
previewUrl?: string;
schema: Schema;
}
Referenced by
export function component<Schema extends {
[Key in any]: ComponentSchema;
}>(options: {

The preview component shown in the editor

preview: (props: PreviewProps<ObjectField<Schema>> & {
onRemove(): void;
}) => import("react").ReactElement | null;

The schema for the props that the preview component, toolbar and rendered component will receive

schema: Schema;

The label to show in the insert menu and chrome around the block if chromeless is false

label: string;

An icon to show in the toolbar for this component block. Component blocks with toolbarIcon are shown in the toolbar directly instead of the insert menu

toolbarIcon?: import("react").ReactElement;
} & ({
chromeless: true;
toolbar?: null | ((props: {
onRemove(): void;
}) => import("react").ReactElement);
} | {
chromeless?: false;
toolbar?: (props: {
onShowEditMode(): void;
onRemove(): void;
}) => import("react").ReactElement;
})): ComponentBlock<Schema>
export type FormFieldInputProps<Value> = {
value: Value;
onChange(value: Value): void;
autoFocus: boolean;

This will be true when validate has returned false and the user has attempted to close the form or when the form is open and they attempt to save the item

forceValidation: boolean;
}
Referenced by
export type JsonYamlValue = string | number | boolean | null | Date | readonly JsonYamlValue[] | {
[key: string]: JsonYamlValue;
}
Referenced by
export type FormFieldStoredValue = JsonYamlValueWithoutNull | undefined
Referenced by
Unexported symbols referenced here
type JsonYamlValueWithoutNull = JsonYamlValue & {}
Referenced by
export type BasicFormField<ParsedValue extends {} | null, ValidatedValue extends ParsedValue = ParsedValue, ReaderValue = ValidatedValue> = {
kind: "form";
formKind?: undefined;
Input(props: FormFieldInputProps<ParsedValue>): import("react").ReactElement | null;
defaultValue(): ParsedValue;
parse(value: FormFieldStoredValue): ParsedValue;

If undefined is returned, the field will generally not be written, except in array fields where it will be stored as null

serialize(value: ParsedValue): { };
validate(value: ParsedValue): ValidatedValue;
reader: {
parse(value: FormFieldStoredValue): ReaderValue;
};
label?: string;
}
Referenced by
export type SlugFormField<ParsedValue extends {} | null, ValidatedValue extends ParsedValue, ReaderValue, ReaderValueAsSlugField> = {
kind: "form";
formKind: "slug";
Input(props: FormFieldInputProps<ParsedValue>): import("react").ReactElement | null;
defaultValue(): ParsedValue;
parse(value: FormFieldStoredValue, extra: {
slug: string;
} | undefined): ParsedValue;
serialize(value: ParsedValue): { };
serializeWithSlug(value: ParsedValue): {
slug: string;
};
validate(value: ParsedValue, extra: {
slugField: {
slugs: Set<string>;
glob: Glob;
};
} | undefined): ValidatedValue;
reader: {
parse(value: FormFieldStoredValue): ReaderValue;
parseWithSlug(value: FormFieldStoredValue, extra: {
slug: string;
glob: Glob;
}): ReaderValueAsSlugField;
};
label?: string;
}
Referenced by
export type AssetFormField<ParsedValue extends {} | null, ValidatedValue extends ParsedValue, ReaderValue> = {
kind: "form";
formKind: "asset";
Input(props: FormFieldInputProps<ParsedValue>): import("react").ReactElement | null;
directory?: string;
defaultValue(): ParsedValue;
filename(value: FormFieldStoredValue, extra: {
suggestedFilenamePrefix: string | undefined;
slug: string | undefined;
}): string | undefined;
parse(value: FormFieldStoredValue, extra: {
asset: Uint8Array | undefined;
slug: string | undefined;
}): ParsedValue;
serialize(value: ParsedValue, extra: {
suggestedFilenamePrefix: string | undefined;
slug: string | undefined;
}): {
asset: {
content: Uint8Array;
filename: string;
} | undefined;
};
validate(value: ParsedValue): ValidatedValue;
reader: {
parse(value: FormFieldStoredValue): ReaderValue;
};
label?: string;
}
Referenced by
export type AssetsFormField<ParsedValue extends {} | null, ValidatedValue extends ParsedValue, ReaderValue> = {
kind: "form";
formKind: "assets";
directories?: string[];
Input(props: FormFieldInputProps<ParsedValue>): import("react").ReactElement | null;
defaultValue(): ParsedValue;
parse(value: FormFieldStoredValue, args: {
other: ReadonlyMap<string, Uint8Array>;
external: ReadonlyMap<string, ReadonlyMap<string, Uint8Array>>;
slug: string | undefined;
}): ParsedValue;
serialize(value: ParsedValue, extra: {
slug: string | undefined;
}): {
other: ReadonlyMap<string, Uint8Array>;
external: ReadonlyMap<string, ReadonlyMap<string, Uint8Array>>;
};
validate(value: ParsedValue): ValidatedValue;
reader: {
parse(value: FormFieldStoredValue): ReaderValue;
};
collaboration?: {
toYjs: (value: ParsedValue) => unknown;
fromYjs: (yjsValue: unknown, awareness: import("y-protocols").Awareness) => ParsedValue;
};
}
Referenced by
export type ContentFormField<ParsedValue extends {} | null, ValidatedValue extends ParsedValue, ReaderValue> = {
kind: "form";
formKind: "content";
contentExtension: string;
directories?: string[];
Input(props: FormFieldInputProps<ParsedValue>): import("react").ReactElement | null;
defaultValue(): ParsedValue;
parse(value: FormFieldStoredValue, args: {
content: Uint8Array | undefined;
other: ReadonlyMap<string, Uint8Array>;
external: ReadonlyMap<string, ReadonlyMap<string, Uint8Array>>;
slug: string | undefined;
}): ParsedValue;
serialize(value: ParsedValue, extra: {
slug: string | undefined;
}): {
content: Uint8Array | undefined;
other: ReadonlyMap<string, Uint8Array>;
external: ReadonlyMap<string, ReadonlyMap<string, Uint8Array>>;
};
validate(value: ParsedValue): ValidatedValue;
reader: {
parse(value: FormFieldStoredValue, extra: {
content: Uint8Array | undefined;
}): ReaderValue;
};
collaboration?: {
toYjs: (value: ParsedValue) => unknown;
fromYjs: (yjsValue: unknown, awareness: import("y-protocols").Awareness) => ParsedValue;
};
}
Referenced by
export type FormField<ParsedValue extends {} | null, ValidatedValue extends ParsedValue, ReaderValue> = BasicFormField<ParsedValue, ValidatedValue, ReaderValue> | SlugFormField<ParsedValue, ValidatedValue, ReaderValue, any> | AssetFormField<ParsedValue, ValidatedValue, ReaderValue> | ContentFormField<ParsedValue, ValidatedValue, ReaderValue> | AssetsFormField<ParsedValue, ValidatedValue, ReaderValue>
Referenced by
export type DocumentNode = DocumentElement | DocumentText
Referenced by
export type DocumentElement = {
children: DocumentNode[];
[key: string]: unknown;
}
Referenced by
export type DocumentText = {
text: string;
[key: string]: unknown;
}
Referenced by
export type ChildField = {
kind: "child";
options: ({
kind: "block";
formatting?: BlockFormattingConfig;
dividers?: "inherit";
links?: "inherit";
images?: "inherit";
tables?: "inherit";
componentBlocks?: "inherit";
} & BlockEditingOptions) | {
kind: "inline";
placeholder: string;
formatting?: {
inlineMarks?: InlineMarksConfig;
softBreaks?: "inherit";
};
links?: "inherit";
};
}
Referenced by
Unexported symbols referenced here
type BlockFormattingConfig = {
alignment?: "inherit";
blockTypes?: "inherit";
headingLevels?: "inherit" | (1 | 2 | 3 | 4 | 5 | 6)[];
inlineMarks?: InlineMarksConfig;
listTypes?: "inherit";
softBreaks?: "inherit";
componentBlocks?: "inherit";
}
Referenced by
type BlockEditingOptions = {
editIn?: "preview";
placeholder: string;
} | {
editIn: "modal";
label: string;
} | {
editIn: "both";
label: string;
placeholder: string;
}
Referenced by
type InlineMarksConfig = "inherit" | {
bold?: "inherit";
code?: "inherit";
italic?: "inherit";
strikethrough?: "inherit";
underline?: "inherit";
keyboard?: "inherit";
subscript?: "inherit";
superscript?: "inherit";
}
Referenced by
export type ArrayField<ElementField extends ComponentSchema> = {
kind: "array";
element: ElementField;
label: string;
description?: string;
itemLabel(props: unknown): string;
asChildTag?: string;
slugField?: string;
validation?: {
length?: {
min?: number;
max?: number;
};
};
Input(props: unknown): import("react").ReactElement | null;
}
Referenced by
export type ObjectFieldOptions = {
label?: string;
description?: string;

Define the number of columns each field should span. The grid layout supports 12 possible columns.

more
less

@example — [6, 6] - "one row, equal columns"

@example — [12, 8, 4] - "one field in the first row, two fields in the second row"

layout?: number[];
}
Referenced by
export type ConditionalField<DiscriminantField extends BasicFormField<string | boolean>, ConditionalValues extends {
[Key in `${ReturnType<DiscriminantField["defaultValue"]>}`]: ComponentSchema;
}> = {
kind: "conditional";
discriminant: DiscriminantField;
values: ConditionalValues;
Input(props: unknown): import("react").ReactElement | null;
}
Referenced by
export type ComponentSchema = ChildField | FormField<any, any, any> | ObjectField | ConditionalField<BasicFormField<any, any, any>, {
[key: string]: ComponentSchema;
}> | ArrayFieldInComponentSchema
Referenced by
Unexported symbols referenced here
type ArrayFieldInComponentSchema = {
kind: "array";
element: ComponentSchema;
label: string;
description?: string;
itemLabel(props: unknown): string;
asChildTag?: string;
slugField?: string;
validation?: {
length?: {
min?: number;
max?: number;
};
};
Input(props: unknown): import("react").ReactElement | null;
}
Referenced by
export * as fields from {
export function array<ElementField extends ComponentSchema>(element: ElementField, opts?: {
label?: string;
description?: string;
itemLabel?: (props: GenericPreviewProps<ElementField, unknown>) => string;
asChildTag?: string;
slugField?: ElementField extends {
kind: "object";
} ? {
[K in keyof ElementField["fields"]]: ElementField["fields"][K] extends SlugFormField<any, any, any, any> ? K : never;
}[keyof ElementField["fields"]] : never;
validation?: {
length?: {
min?: number;
max?: number;
};
};
}): ArrayField<ElementField>
export function blocks<Schemas extends Record<string, ComponentSchema>>(blocks: {
[K in keyof Schemas]: {
label: string;
itemLabel?: (props: GenericPreviewProps<Schemas[K], unknown>) => string;
schema: Schemas[K];
};
}, opts: {
label: string;
description?: string;
validation?: {
length?: {
min?: number;
max?: number;
};
};
}): ArrayField<ConditionalField<BasicFormField<keyof Schemas & string>, Schemas>>
export function checkbox({ label, defaultValue, description, }: {
label: string;
defaultValue?: boolean;
description?: string;
}): BasicFormField<boolean>
export function child(options: ({
kind: "block";
formatting?: BlockFormattingConfig | "inherit";
dividers?: "inherit";
links?: "inherit";
images?: "inherit";
tables?: "inherit";
componentBlocks?: "inherit";
} & BlockEditingOptions) | {
kind: "inline";
placeholder: string;
formatting?: "inherit" | {
inlineMarks?: InlineMarksConfig;
softBreaks?: "inherit";
};
links?: "inherit";
}): ChildField
export function cloudImage({ label, description, validation, }: {
label: string;
description?: string;
validation?: {
isRequired?: boolean;
};
}): ObjectField<typeof cloudImageSchema>
Unexported symbols referenced here
const cloudImageSchema: {
src: SlugFormField<string, string, string, null>;
alt: SlugFormField<string, string, string, null>;
height: BasicFormField<number | null, number | null>;
width: BasicFormField<number | null, number | null>;
} = ...
Referenced by
export function conditional<DiscriminantField extends BasicFormField<string> | BasicFormField<boolean>, ConditionalValues extends {
[Key in `${ReturnType<DiscriminantField["defaultValue"]>}`]: ComponentSchema;
}>(discriminant: DiscriminantField, values: ConditionalValues): ConditionalField<DiscriminantField, ConditionalValues>
export function date<IsRequired extends boolean | undefined>({ label, defaultValue, validation, description, }: {
label: string;
defaultValue?: string | {
kind: "today";
};
validation?: {
isRequired?: IsRequired;
min?: string;
max?: string;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<string | null, string | (IsRequired extends true ? never : null)>
Unexported symbols referenced here
type RequiredValidation<IsRequired extends boolean | undefined> = IsRequired extends true ? {
validation: {
isRequired: true;
};
} : unknown
Referenced by
export function datetime<IsRequired extends boolean | undefined>({ label, defaultValue, validation, description, }: {
label: string;
defaultValue?: string | {
kind: "now";
};
validation?: {
isRequired?: IsRequired;
min?: string;
max?: string;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<string | null, string | (IsRequired extends true ? never : null)>

@deprecated — fields.markdoc has superseded this field. fields.mdx is also available if you prefer MDX.

export function document({ label, componentBlocks, description, ...documentFeaturesConfig }: {
label: string;
componentBlocks?: Record<string, ComponentBlock>;
description?: string;
} & DocumentFeaturesConfig): ContentFormField<DocumentElement[], DocumentElement[], DocumentElement[]>
Unexported symbols referenced here
type DocumentFeaturesConfig = {
formatting?: true | FormattingConfig;
links?: true;
dividers?: true;
images?: true | {
directory?: string;
publicPath?: string;
schema?: { };
};
layouts?: readonly (readonly [number, ...number[]])[];
tables?: true;
}
Referenced by
type FormattingConfig = {
inlineMarks?: true | {
bold?: true;
italic?: true;
underline?: true;
strikethrough?: true;
code?: true;
superscript?: true;
subscript?: true;
keyboard?: true;
};
listTypes?: true | {
ordered?: true;
unordered?: true;
};
alignment?: true | {
center?: true;
end?: true;
};
headingLevels?: HeadingLevels | {
levels: HeadingLevels;
schema?: Record<string, ComponentSchema>;
};
blockTypes?: true | {
blockquote?: true;
code?: true | {
schema?: Record<string, ComponentSchema>;
};
};
softBreaks?: true;
}
Referenced by
type BasicStringFormField = BasicFormField<string> | SlugFormField<string, string, string, null>
Referenced by
type HeadingLevels = true | readonly (1 | 2 | 3 | 4 | 5 | 6)[]
Referenced by
export function empty(): BasicFormField<null>

@deprecated — emptyDocument has been replaced with the emptyContent field

export function emptyDocument(): ContentFormField<null, null, null>
export function emptyContent(opts: {
extension: "mdoc" | "md" | "mdx";
}): ContentFormField<null, null, null>
export function file<IsRequired extends boolean | undefined>({ label, directory, validation, description, publicPath, transformFilename, }: {
label: string;
directory?: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
publicPath?: string;

This function will only be used when fields.file is used in a field like fields.markdoc/fields.mdx.

more
less

When used outside of editor fields, this function will not be used. Instead only the extension of the uploaded file is used and the start of the filename is based on the field key.

transformFilename?: (originalFilename: string) => string;
} & RequiredValidation<IsRequired>): AssetFormField<{
data: Uint8Array;
extension: string;
filename: string;
} | null, {
data: Uint8Array;
extension: string;
filename: string;
} | (IsRequired extends true ? never : null), string | (IsRequired extends true ? never : null)>
export function image<IsRequired extends boolean | undefined>({ label, directory, validation, description, publicPath, transformFilename, }: {
label: string;
directory?: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
publicPath?: string;

This function will only be used when fields.image is used in a field like fields.markdoc/fields.mdx.

more
less

When used outside of editor fields, this function will not be used. Instead only the extension of the uploaded file is used and the start of the filename is based on the field key.

transformFilename?: (originalFilename: string) => string;
} & RequiredValidation<IsRequired>): AssetFormField<{
data: Uint8Array;
extension: string;
filename: string;
} | null, {
data: Uint8Array;
extension: string;
filename: string;
} | (IsRequired extends true ? never : null), string | (IsRequired extends true ? never : null)>
export function integer<IsRequired extends boolean | undefined>({ label, defaultValue, validation, description, }: {
label: string;
defaultValue?: number;
validation?: {
isRequired?: IsRequired;
min?: number;
max?: number;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<number | null, number | (IsRequired extends true ? never : null)>
export function multiRelationship({ label, collection, validation, description, }: {
label: string;
collection: string;
validation?: {
length?: {
min?: number;
max?: number;
};
};
description?: string;
}): BasicFormField<string[]>
export function multiselect<Option extends {
label: string;
value: string;
}>({ label, options, defaultValue, description, }: {
label: string;
options: readonly Option[];
defaultValue?: readonly Option["value"][];
description?: string;
}): BasicFormField<readonly Option["value"][]> & {
options: readonly Option[];
}
export function number<IsRequired extends boolean | undefined>({ label, defaultValue, step, validation, description, }: {
label: string;
defaultValue?: number;
step?: number;
validation?: {
isRequired?: IsRequired;
min?: number;
max?: number;
step?: boolean;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<number | null, number | (IsRequired extends true ? never : null)>
export function object<Fields extends Record<string, ComponentSchema>>(fields: Fields, opts?: ObjectFieldOptions): ObjectField<Fields>
export function pathReference<IsRequired extends boolean | undefined>({ label, pattern, validation, description, }: {
label: string;
pattern?: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<string | null, string | (IsRequired extends true ? never : null)>
export function relationship<IsRequired extends boolean | undefined>({ label, collection, validation, description, }: {
label: string;
collection: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<string | null, string | (IsRequired extends true ? never : null)>
export function select<Option extends {
label: string;
value: string;
}>({ label, options, defaultValue, description, }: {
label: string;
options: readonly Option[];
defaultValue: Option["value"];
description?: string;
}): BasicFormField<Option["value"]> & {
options: readonly Option[];
}
export function slug(_args: {
name: {
label: string;
defaultValue?: string;
description?: string;
validation?: {
isRequired?: boolean;
length?: {
min?: number;
max?: number;
};
pattern?: {
regex: RegExp;
message?: string;
};
};
};
slug?: {
label?: string;
generate?: (name: string) => string;
description?: string;
validation?: {
length?: {
min?: number;
max?: number;
};
pattern?: {
regex: RegExp;
message?: string;
};
};
};
}): SlugFormField<{
name: string;
slug: string;
}, {
name: string;
slug: string;
}, {
name: string;
slug: string;
}, string>
export function text({ label, defaultValue, validation: { length: { max, min }, pattern, isRequired, }, description, multiline, }: {
label: string;
defaultValue?: string | (() => string);
description?: string;
validation?: {
isRequired?: boolean;
length?: {
min?: number;
max?: number;
};
pattern?: {
regex: RegExp;
message?: string;
};
};
multiline?: boolean;
}): SlugFormField<string, string, string, null>
export function url<IsRequired extends boolean | undefined>({ label, defaultValue, validation, description, }: {
label: string;
defaultValue?: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
} & RequiredValidation<IsRequired>): BasicFormField<string | null, string | (IsRequired extends true ? never : null)>
export function ignored(): BasicFormField<{ }, { }, unknown>
export function mdx({ label, description, options, components, extension, }: {
label: string;
description?: string;
options?: MDXEditorOptions;
extension?: "mdx" | "md";
components?: Record<string, ContentComponent>;
}): Field
export namespace mdx {
export var inline: ({ label, description, options, components, }: {
label: string;
description?: string;
options?: MDXEditorOptions;
components?: Record<string, ContentComponent>;
}) => Field = ...
export namespace inline {
export type Field = AssetsFormField<EditorState, EditorState, string>
Referenced by
}
Referenced by
export type Field = ContentFormField<EditorState, EditorState, string>
Referenced by
}
export namespace mdx {
export var inline: ({ label, description, options, components, }: {
label: string;
description?: string;
options?: MDXEditorOptions;
components?: Record<string, ContentComponent>;
}) => Field = ...
export namespace inline {
export type Field = AssetsFormField<EditorState, EditorState, string>
Referenced by
}
Referenced by
export type Field = ContentFormField<EditorState, EditorState, string>
Referenced by
}
export declare namespace mdx.inline {
    type Field = AssetsFormField<EditorState, EditorState, string>;
}
Unexported symbols referenced here
type MDXEditorOptions = {
bold?: boolean;
italic?: boolean;
strikethrough?: boolean;
code?: boolean;
heading?: HeadingLevels;
blockquote?: boolean;
orderedList?: boolean;
unorderedList?: boolean;
table?: boolean;
link?: boolean;
image?: boolean | {
directory?: string;
publicPath?: string;
transformFilename?: (originalFilename: string) => string;
schema?: { };
};
divider?: boolean;
codeBlock?: boolean;
}
Referenced by
type HeadingLevels = boolean | readonly (1 | 2 | 3 | 4 | 5 | 6)[]
Referenced by
type BasicStringFormField = BasicFormField<string> | SlugFormField<string, string, string, null>
Referenced by
export function markdoc({ label, description, options, components, extension, }: {
label: string;
description?: string;
extension?: "mdoc" | "md";
components?: Record<string, ContentComponent>;
}): Field
export namespace markdoc {
export var createMarkdocConfig: typeof createMarkdocConfig = ...
Referenced by
Unexported symbols referenced here
function createMarkdocConfig<Components extends Record<string, ContentComponent>>(opts: {
components?: Components;
render?: {
tags?: {
[_ in keyof Components]?: string;
};
nodes?: {
[_ in import("@markdoc/markdoc").NodeType]?: string;
};
};
}): import("@markdoc/markdoc").Config
Referenced by
export var inline: ({ label, description, options, components, }: {
label: string;
description?: string;
components?: Record<string, ContentComponent>;
}) => Field = ...
export namespace inline {
export type Field = AssetsFormField<EditorState, EditorState, { }>
Referenced by
}
Referenced by
export type Field = ContentFormField<EditorState, EditorState, { }>
Referenced by
}
export namespace markdoc {
export var createMarkdocConfig: typeof createMarkdocConfig = ...
Referenced by
Unexported symbols referenced here
function createMarkdocConfig<Components extends Record<string, ContentComponent>>(opts: {
components?: Components;
render?: {
tags?: {
[_ in keyof Components]?: string;
};
nodes?: {
[_ in import("@markdoc/markdoc").NodeType]?: string;
};
};
}): import("@markdoc/markdoc").Config
Referenced by
export var inline: ({ label, description, options, components, }: {
label: string;
description?: string;
components?: Record<string, ContentComponent>;
}) => Field = ...
export namespace inline {
export type Field = AssetsFormField<EditorState, EditorState, { }>
Referenced by
}
Referenced by
export type Field = ContentFormField<EditorState, EditorState, { }>
Referenced by
}
export declare namespace markdoc.inline {
    type Field = AssetsFormField<EditorState, EditorState, {
        node: MarkdocNode;
    }>;
}
Unexported symbols referenced here
type MarkdocEditorOptions = {
bold?: boolean;
italic?: boolean;
strikethrough?: boolean;
code?: boolean;
heading?: HeadingLevels | {
levels: HeadingLevels;
schema: Record<string, ComponentSchema>;
};
blockquote?: boolean;
orderedList?: boolean;
unorderedList?: boolean;
table?: boolean;
link?: boolean;
image?: boolean | {
directory?: string;
publicPath?: string;
transformFilename?: (originalFilename: string) => string;
schema?: { };
};
divider?: boolean;
codeBlock?: boolean | {
schema: Record<string, ComponentSchema>;
};
}
Referenced by
}
export type ComponentBlock<Fields extends Record<string, ComponentSchema> = Record<string, ComponentSchema>> = {
preview: (props: any) => import("react").ReactElement | null;
schema: Fields;
label: string;
toolbarIcon?: import("react").ReactElement;
} & ({
chromeless: true;
toolbar?: (props: {
props: Record<string, any>;
onRemove(): void;
}) => import("react").ReactElement;
} | {
chromeless?: false;
toolbar?: (props: {
props: Record<string, any>;
onShowEditMode(): void;
onRemove(): void;
isValid: boolean;
}) => import("react").ReactElement;
})
Referenced by
export type GenericPreviewProps<Schema extends ComponentSchema, ChildFieldElement> = Schema extends ChildField ? ChildFieldPreviewProps<Schema, ChildFieldElement> : Schema extends FormField<any, any, any> ? FormFieldPreviewProps<Schema> : Schema extends ObjectField<any> ? ObjectFieldPreviewProps<Schema, ChildFieldElement> : Schema extends ConditionalField<any, any> ? ConditionalFieldPreviewProps<Schema, ChildFieldElement> : Schema extends ArrayField<any> ? ArrayFieldPreviewProps<Schema, ChildFieldElement> : never
Referenced by
Unexported symbols referenced here
type ChildFieldPreviewProps<Schema extends ChildField, ChildFieldElement> = {
readonly element: ChildFieldElement;
readonly schema: Schema;
}
Referenced by
type FormFieldPreviewProps<Schema extends FormField<any, any, any>> = {
readonly value: ReturnType<Schema["defaultValue"]>;
onChange(value: ReturnType<Schema["defaultValue"]>): void;
readonly schema: Schema;
}
Referenced by
type ObjectFieldPreviewProps<Schema extends ObjectField<any>, ChildFieldElement> = {
readonly fields: {
readonly [Key in keyof Schema["fields"]]: GenericPreviewProps<Schema["fields"][Key], ChildFieldElement>;
};
onChange(value: {
readonly [Key in keyof Schema["fields"]]?: InitialOrUpdateValueFromComponentPropField<Schema["fields"][Key]>;
}): void;
readonly schema: Schema;
}
Referenced by
type ConditionalFieldPreviewProps<Schema extends ConditionalField<BasicFormField<string | boolean>, any>, ChildFieldElement> = {
readonly [Key in keyof Schema["values"]]: {
readonly discriminant: DiscriminantStringToDiscriminantValue<Schema["discriminant"], Key>;
onChange<Discriminant extends ReturnType<Schema["discriminant"]["defaultValue"]>>(discriminant: Discriminant, value?: InitialOrUpdateValueFromComponentPropField<Schema["values"][`${Discriminant}`]>): void;
readonly value: GenericPreviewProps<Schema["values"][Key], ChildFieldElement>;
readonly schema: Schema;
};
}[keyof Schema["values"]]
Referenced by
type ArrayFieldPreviewProps<Schema extends ArrayField<ComponentSchema>, ChildFieldElement> = {
readonly elements: readonly (GenericPreviewProps<Schema["element"], ChildFieldElement> & {
readonly key: string;
})[];
readonly onChange: (value: readonly {
key: string | undefined;
value?: InitialOrUpdateValueFromComponentPropField<Schema["element"]>;
}[]) => void;
readonly schema: Schema;
}
Referenced by
export type PreviewProps<Schema extends ComponentSchema> = GenericPreviewProps<Schema, import("react").ReactNode>
Referenced by
export type InitialOrUpdateValueFromComponentPropField<Schema extends ComponentSchema> = Schema extends ChildField ? undefined : Schema extends FormField<infer ParsedValue, any, any> ? ParsedValue | undefined : Schema extends ObjectField<infer Value> ? {
readonly [Key in keyof Value]?: InitialOrUpdateValueFromComponentPropField<Value[Key]>;
} : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
readonly [Key in keyof Values]: {
readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
readonly value?: InitialOrUpdateValueFromComponentPropField<Values[Key]>;
};
}[keyof Values] : Schema extends ArrayField<infer ElementField> ? readonly {
key: string | undefined;
}[] : never
Referenced by
Unexported symbols referenced here
type DiscriminantStringToDiscriminantValue<DiscriminantField extends FormField<any, any, any>, DiscriminantString extends PropertyKey> = ReturnType<DiscriminantField["defaultValue"]> extends boolean ? "true" extends DiscriminantString ? true : "false" extends DiscriminantString ? false : never : DiscriminantString & string
Referenced by
export type PreviewPropsForToolbar<Schema extends ComponentSchema> = GenericPreviewProps<Schema, undefined>
Referenced by
export type ParsedValueForComponentSchema<Schema extends ComponentSchema> = Schema extends ChildField ? null : Schema extends FormField<infer Value, any, any> ? Value : Schema extends ObjectField<infer Value> ? {
readonly [Key in keyof Value]: ParsedValueForComponentSchema<Value[Key]>;
} : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
readonly [Key in keyof Values]: {
readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
readonly value: ParsedValueForComponentSchema<Values[Key]>;
};
}[keyof Values] : Schema extends ArrayField<infer ElementField> ? readonly ParsedValueForComponentSchema<ElementField>[] : never
Referenced by
export type ValueForReading<Schema extends ComponentSchema> = Schema extends ChildField ? null : Schema extends ContentFormField<any, any, infer Value> ? () => Promise<Value> : Schema extends BasicFormField<any, any, infer Value> ? Value : Schema extends SlugFormField<any, any, infer Value, any> ? Value : Schema extends AssetFormField<any, any, infer Value> ? Value : Schema extends AssetsFormField<any, any, infer Value> ? Value : Schema extends ObjectField<infer Value> ? {
readonly [Key in keyof Value]: ValueForReading<Value[Key]>;
} : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
readonly [Key in keyof Values]: {
readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
readonly value: ValueForReading<Values[Key]>;
};
}[keyof Values] : Schema extends ArrayField<infer ElementField> ? readonly ValueForReading<ElementField>[] : never
Referenced by
export type ValueForReadingDeep<Schema extends ComponentSchema> = Schema extends ChildField ? null : Schema extends FormField<any, any, infer Value> ? Value : Schema extends ObjectField<infer Value> ? {
readonly [Key in keyof Value]: ValueForReadingDeep<Value[Key]>;
} : Schema extends ConditionalField<infer DiscriminantField, infer Values> ? {
readonly [Key in keyof Values]: {
readonly discriminant: DiscriminantStringToDiscriminantValue<DiscriminantField, Key>;
readonly value: ValueForReadingDeep<Values[Key]>;
};
}[keyof Values] : Schema extends ArrayField<infer ElementField> ? readonly ValueForReadingDeep<ElementField>[] : never
Referenced by
export type InferRenderersForComponentBlocks<ComponentBlocks extends Record<string, ComponentBlock<any>>> = {
[Key in keyof ComponentBlocks]: Comp<ValueForReading<ObjectField<ComponentBlocks[Key]["schema"]>>>;
}
Unexported symbols referenced here
type Comp<Props> = (props: Props) => import("react").ReactElement | null
Referenced by
}
module "@keystatic/core/api/utils" {
export function getAllowedDirectories(config: Config): string[]
}
module "@keystatic/core/renderer" {
export function DocumentRenderer<ComponentBlocks extends Record<string, Component<any>>>(props: DocumentRendererProps<ComponentBlocks>): import("react").Element
Unexported symbols referenced here
type Component<Props> = (props: Props) => import("react").ReactElement | null
Referenced by
export const defaultRenderers: Renderers = ...
Unexported symbols referenced here
interface Renderers {
inline: {
link: Component<{
children: import("react").ReactNode;
href: string;
}> | "a";
} & MarkRenderers;
block: {
paragraph: Component<{
children: import("react").ReactNode;
textAlign: "center" | "end" | undefined;
}>;
code: Component<{
children: string;
language?: string;
[key: string]: unknown;
}> | keyof import("react").IntrinsicElements;
layout: Component<{
layout: [number, ...number[]];
children: import("react").ReactElement[];
}>;
divider: Component<{}> | keyof import("react").IntrinsicElements;
heading: Component<{
level: 1 | 2 | 3 | 4 | 5 | 6;
children: import("react").ReactNode;
textAlign: "center" | "end" | undefined;
[key: string]: unknown;
}>;
list: Component<{
type: "ordered" | "unordered";
children: import("react").ReactElement[];
}>;
image: Component<{
src: string;
alt: string;
title?: string;
}>;
table: Component<{
head?: {
children: import("react").ReactNode;
colSpan?: number;
rowSpan?: number;
}[];
body: {
children: import("react").ReactNode;
colSpan?: number;
rowSpan?: number;
}[][];
}>;
};
}
Referenced by
type MarkRenderers = { }
Referenced by
type OnlyChildrenComponent = Component<{
children: import("react").ReactNode;
}> | keyof import("react").IntrinsicElements
Referenced by
type Mark = "bold" | "italic" | "underline" | "strikethrough" | "code" | "superscript" | "subscript" | "keyboard"
Referenced by
export type DocumentRendererProps<ComponentBlocks extends Record<string, Component<any>> = Record<string, Component<any>>> = {
document: Element[];
renderers?: {
inline?: Partial<Renderers["inline"]>;
block?: Partial<Renderers["block"]>;
};
componentBlocks?: ComponentBlocks;
}
Referenced by
Unexported symbols referenced here
type Element = {
children: Node[];
[key: string]: unknown;
}
Referenced by
type Node = Element | Text
Referenced by
type Text = {
text: string;
[key: string]: unknown;
}
Referenced by
}
module "@keystatic/core/api/generic" {
export function makeGenericAPIRouteHandler(_config: APIRouteConfig, options?: {
slugEnvName?: string;
}): (req: KeystaticRequest) => Promise<KeystaticResponse>
Unexported symbols referenced here
type KeystaticRequest = {
headers: {
get(name: string): string | null;
};
method: string;
url: string;
json: () => Promise<any>;
}
Referenced by
type KeystaticResponse = ResponseInit & {
body: Uint8Array | string | null;
}
Referenced by
export type APIRouteConfig = {

@default — process.env.KEYSTATIC_GITHUB_CLIENT_ID

clientId?: string;

@default — process.env.KEYSTATIC_GITHUB_CLIENT_SECRET

clientSecret?: string;

@default — process.env.KEYSTATIC_SECRET

secret?: string;
localBaseDirectory?: string;
config: Config<any, any>;
}
Referenced by
}
module "@keystatic/core/reader" {
export function createReader<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}>(repoPath: string, config: Config<Collections, Singletons>): Reader<Collections, Singletons>
export type Entry<CollectionOrSingleton extends Collection<any, any> | Singleton<any>> = CollectionOrSingleton extends Collection<infer Schema, infer SlugField> ? CollectionEntry<Schema, SlugField> : CollectionOrSingleton extends Singleton<infer Schema> ? SingletonEntry<Schema> : never
Unexported symbols referenced here
type CollectionEntry<Schema extends Record<string, ComponentSchema>, SlugField extends string> = {
[Key in keyof Schema]: SlugField extends Key ? Schema[Key] extends SlugFormField<any, any, any, infer SlugSerializedValue> ? SlugSerializedValue : ValueForReading<Schema[Key]> : ValueForReading<Schema[Key]>;
}
Referenced by
type SingletonEntry<Schema extends Record<string, ComponentSchema>> = ValueForReading<ObjectField<Schema>>
Referenced by
export type EntryWithResolvedLinkedFiles<CollectionOrSingleton extends Collection<any, any> | Singleton<any>> = CollectionOrSingleton extends Collection<infer Schema, infer SlugField> ? CollectionEntryWithResolvedLinkedFiles<Schema, SlugField> : CollectionOrSingleton extends Singleton<infer Schema> ? SingletonEntryWithResolvedLinkedFiles<Schema> : never
Unexported symbols referenced here
type CollectionEntryWithResolvedLinkedFiles<Schema extends Record<string, ComponentSchema>, SlugField extends string> = {
[Key in keyof Schema]: SlugField extends Key ? Schema[Key] extends SlugFormField<any, any, any, infer SlugSerializedValue> ? SlugSerializedValue : ValueForReadingDeep<Schema[Key]> : ValueForReadingDeep<Schema[Key]>;
}
Referenced by
type SingletonEntryWithResolvedLinkedFiles<Schema extends Record<string, ComponentSchema>> = ValueForReadingDeep<ObjectField<Schema>>
Referenced by
export type Reader<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = BaseReader<Collections, Singletons> & {
repoPath: string;
}
Referenced by
Unexported symbols referenced here
type BaseReader<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = {
collections: {
[Key in keyof Collections]: CollectionReader<Collections[Key]["schema"], Collections[Key]["slugField"]>;
};
singletons: {
[Key in keyof Singletons]: SingletonReader<Singletons[Key]["schema"]>;
};
config: Config<Collections, Singletons>;
}
Referenced by
type CollectionReader<Schema extends Record<string, ComponentSchema>, SlugField extends string> = {
read: <Opts extends [EntryReaderOpts?]>(slug: string, ...opts: Opts & [EntryReaderOpts?]) => Promise<{
[Key in keyof Schema]: SlugField extends Key ? Schema[Key] extends SlugFormField<any, any, any, infer SlugSerializedValue> ? SlugSerializedValue : ValueForReadingWithMode<Schema[Key], OptionalChain<Opts[0], "resolveLinkedFiles">> : ValueForReadingWithMode<Schema[Key], OptionalChain<Opts[0], "resolveLinkedFiles">>;
} | null>;
readOrThrow: <Opts extends [EntryReaderOpts?]>(slug: string, ...opts: Opts & [EntryReaderOpts?]) => Promise<{
[Key in keyof Schema]: SlugField extends Key ? Schema[Key] extends SlugFormField<any, any, any, infer SlugSerializedValue> ? SlugSerializedValue : ValueForReadingWithMode<Schema[Key], OptionalChain<Opts[0], "resolveLinkedFiles">> : ValueForReadingWithMode<Schema[Key], OptionalChain<Opts[0], "resolveLinkedFiles">>;
}>;
all: <Opts extends [EntryReaderOpts?]>(...opts: Opts & [EntryReaderOpts?]) => Promise<{
slug: string;
entry: {
[Key in keyof Schema]: SlugField extends Key ? Schema[Key] extends SlugFormField<any, any, any, infer SlugSerializedValue> ? SlugSerializedValue : ValueForReadingWithMode<Schema[Key], OptionalChain<Opts[0], "resolveLinkedFiles">> : ValueForReadingWithMode<Schema[Key], OptionalChain<Opts[0], "resolveLinkedFiles">>;
};
}[]>;
list: () => Promise<string[]>;
}
Referenced by
type SingletonReader<Schema extends Record<string, ComponentSchema>> = {
read: <Opts extends [EntryReaderOpts?]>(...opts: Opts & [EntryReaderOpts?]) => Promise<ValueForReadingWithMode<ObjectField<Schema>, OptionalChain<Opts[0], "resolveLinkedFiles">> | null>;
readOrThrow: <Opts extends [EntryReaderOpts?]>(...opts: Opts & [EntryReaderOpts?]) => Promise<ValueForReadingWithMode<ObjectField<Schema>, OptionalChain<Opts[0], "resolveLinkedFiles">>>;
}
Referenced by
type EntryReaderOpts = {
resolveLinkedFiles?: boolean;
}
Referenced by
type ValueForReadingWithMode<Schema extends ComponentSchema, ResolveLinkedFiles extends boolean | undefined> = ResolveLinkedFiles extends true ? ValueForReadingDeep<Schema> : ValueForReading<Schema>
Referenced by
type OptionalChain<T extends {} | undefined, Key extends keyof (T & {})> = T extends {} ? T[Key] : undefined
Referenced by
}
module "@keystatic/core/reader/github" {
export function createGitHubReader<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}>(config: Config<Collections, Singletons>, opts: {
repo: `${string}/${string}`;
pathPrefix?: string;
ref?: string;
token?: string;
}): Reader<Collections, Singletons>
export type Reader<Collections extends {
[key: string]: Collection<Record<string, ComponentSchema>, string>;
}, Singletons extends {
[key: string]: Singleton<Record<string, ComponentSchema>>;
}> = BaseReader<Collections, Singletons>
Referenced by
}
module "@keystatic/core/content-components" {
export function wrapper<Schema extends Record<string, ComponentSchema>>(config: WrapperComponentConfig<Schema>): WrapperComponent<Schema>
Unexported symbols referenced here
type WrapperComponentConfig<Schema extends Record<string, ComponentSchema>> = {
label: string;
description?: string;
icon?: import("react").ReactElement;
schema: Schema;
forSpecificLocations?: boolean;
} & ({
ContentView?: (props: {
children: import("react").ReactNode;
}) => import("react").ReactNode;
} | {
NodeView?: (props: {
onChange(value: ParsedValueForComponentSchema<ObjectField<Schema>>): void;
onRemove(): void;
isSelected: boolean;
children: import("react").ReactNode;
}) => import("react").ReactNode;
})
Referenced by
type WrapperComponent<Schema extends Record<string, ComponentSchema>> = WrapperComponentConfig<Schema> & {
kind: "wrapper";
}
Referenced by
export function block<Schema extends Record<string, ComponentSchema>>(config: BlockComponentConfig<Schema>): BlockComponent<Schema>
Unexported symbols referenced here
type BlockComponentConfig<Schema extends Record<string, ComponentSchema>> = {
label: string;
description?: string;
icon?: import("react").ReactElement;
schema: Schema;
forSpecificLocations?: boolean;
} & ({
ContentView?: (props: { }) => import("react").ReactNode;
} | {
NodeView?: (props: {
onChange(value: ParsedValueForComponentSchema<ObjectField<Schema>>): void;
onRemove(): void;
isSelected: boolean;
}) => import("react").ReactNode;
})
Referenced by
type BlockComponent<Schema extends Record<string, ComponentSchema>> = BlockComponentConfig<Schema> & {
kind: "block";
handleFile?: (file: File, config: Config) => false | Promise<ParsedValueForComponentSchema<ObjectField<Schema>>>;
}
Referenced by
export function inline<Schema extends Record<string, ComponentSchema>>(config: InlineComponentConfig<Schema>): InlineComponent<Schema>
Unexported symbols referenced here
type InlineComponentConfig<Schema extends Record<string, ComponentSchema>> = {
label: string;
description?: string;
icon?: import("react").ReactElement;
schema: Schema;
ToolbarView(props: {
onChange(value: ParsedValueForComponentSchema<ObjectField<Schema>>): void;
onRemove(): void;
}): import("react").ReactNode;
} & ({
ContentView?: (props: { }) => import("react").ReactNode;
} | {
NodeView?: (props: {
onChange(value: ParsedValueForComponentSchema<ObjectField<Schema>>): void;
onRemove(): void;
isSelected: boolean;
}) => import("react").ReactNode;
})
Referenced by
type InlineComponent<Schema extends Record<string, ComponentSchema>> = InlineComponentConfig<Schema> & {
kind: "inline";
handleFile?: (file: File, config: Config) => false | Promise<ParsedValueForComponentSchema<ObjectField<Schema>>>;
}
Referenced by
export function mark<Schema extends Record<string, ComponentSchema>>(config: MarkComponentConfig<Schema>): MarkComponent<Schema>
Unexported symbols referenced here
type MarkComponentConfig<Schema extends Record<string, ComponentSchema>> = {
label: string;
icon: import("react").ReactElement;
schema: Schema;
tag?: "span" | "strong" | "em" | "u" | "del" | "code" | "a" | "sub" | "sup" | "kbd" | "abbr" | "mark" | "s" | "small" | "big";
style?: Thing<{
[key: string]: string;
}, Schema>;
className?: Thing<string, Schema>;
}
Referenced by
type MarkComponent<Schema extends Record<string, ComponentSchema>> = MarkComponentConfig<Schema> & {
kind: "mark";
}
Referenced by
type Thing<T, Schema extends Record<string, ComponentSchema>> = T | {
method(props: { }): T;
}["method"]
Referenced by
export function repeating<Schema extends Record<string, ComponentSchema>>(config: RepeatingComponentConfig<Schema>): RepeatingComponent<Schema>
Unexported symbols referenced here
type RepeatingComponentConfig<Schema extends Record<string, ComponentSchema>> = WrapperComponentConfig<Schema> & {
children: string | string[];
validation?: {
children?: {
min?: number;
max?: number;
};
};
}
Referenced by
type RepeatingComponent<Schema extends Record<string, ComponentSchema>> = WrapperComponentConfig<Schema> & {
kind: "repeating";
children: string[];
validation: {
children: {
min: number;
max: number;
};
};
}
Referenced by
export function cloudImage(args: {
label: string;
}): BlockComponent<{
src: SlugFormField<string, string, string, null>;
alt: SlugFormField<string, string, string, null>;
height: BasicFormField<number | null>;
width: BasicFormField<number | null>;
}>
export type ContentComponent = WrapperComponent<Record<string, ComponentSchema>> | BlockComponent<Record<string, ComponentSchema>> | RepeatingComponent<Record<string, ComponentSchema>> | InlineComponent<Record<string, ComponentSchema>> | MarkComponent<Record<string, ComponentSchema>>
Referenced by
}
module "@keystatic/core/component-blocks" {

@deprecated — Experimental

export function cloudImage(args: {
label: string;
}): ComponentBlock<{
src: SlugFormField<string, string, string, null>;
alt: SlugFormField<string, string, string, null>;
height: BasicFormField<number | null, number | null>;
width: BasicFormField<number | null, number | null>;
}>
export type CloudImageProps = {
src: string;
width?: number;
height?: number;
alt: string;
}
}