@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[];
}
}
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>): 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;
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;
}
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 JsonValue = string | number | boolean | null | readonly JsonValue[] | {
[key: string]: JsonValue;
}
Referenced by
export type FormFieldStoredValue = JsonValueWithoutNull | undefined
Referenced by
Unexported symbols referenced here
type JsonValueWithoutNull = JsonValue & {}
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;
};
}
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;
};
}
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;
};
}
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;
};
}
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>
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;
}
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 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 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)>
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 emptyDocument(): ContentFormField<null, null, null>
export function empty(): BasicFormField<null>
export function image<IsRequired extends boolean | undefined>({ label, directory, validation, description, publicPath, }: {
label: string;
directory?: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
publicPath?: 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 file<IsRequired extends boolean | undefined>({ label, directory, validation, description, publicPath, }: {
label: string;
directory?: string;
validation?: {
isRequired?: IsRequired;
};
description?: string;
publicPath?: 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 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 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?: {
length?: {
min?: number;
max?: number;
};
};
};
slug?: {
label?: string;
generate?: (name: string) => string;
description?: string;
validation?: {
length?: {
min?: number;
max?: number;
};
};
};
}): SlugFormField<{
name: string;
slug: string;
}, {
name: string;
slug: string;
}, {
name: string;
slug: string;
}, string>
export function text({ label, defaultValue, validation: { length: { max, min } }, description, multiline, }: {
label: string;
defaultValue?: string | (() => string);
description?: string;
validation?: {
length?: {
min?: number;
max?: number;
};
};
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 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 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 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
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 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/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;
}
}
module "@keystatic/core/form/fields/markdoc" {

@deprecated — This is experimental and buggy, use at your own risk.

export function __experimental_markdoc_field({ label, description, config, }: {
label: string;
description?: string;
config: import("@markdoc/markdoc").Config;
}): Field
export namespace __experimental_markdoc_field {
export type Field = ContentFormField<EditorState, EditorState, { }>
Referenced by
}
}