@dossierhq/core
Version:
The core Dossier library used by clients and server alike, used to interact with schema and entities directly, as well as remotely through a client.
23 lines (22 loc) • 1.25 kB
TypeScript
import { type FieldSpecification, type PublishedFieldSpecification } from '../schema/SchemaSpecification.js';
import type { Entity, EntityCreate, EntityLike, PublishedEntity, RichTextNode } from '../Types.js';
import type { ContentValuePath } from './ContentPath.js';
export declare function getEntityNameBase(name: string): string;
export declare function isEntityNameAsRequested(currentName: string, requestedName: string): boolean;
export declare function copyEntity<T extends Entity<string, object> | EntityCreate<Entity<string, object>> | PublishedEntity<string, object> | EntityLike<string, object>>(entity: Readonly<T> | T, changes: {
id?: string;
info?: Partial<T['info']>;
fields?: Partial<T['fields']>;
}): Readonly<T>;
export declare function checkFieldTraversable(fieldSpec: FieldSpecification | PublishedFieldSpecification, value: unknown): {
path: ContentValuePath;
message: string;
} | null;
export declare function checkFieldItemTraversable(fieldSpec: FieldSpecification | PublishedFieldSpecification, value: unknown): {
path: ContentValuePath;
message: string;
} | null;
export declare function checkRichTextNodeTraversable(node: RichTextNode): {
path: ContentValuePath;
message: string;
} | null;