import type { StyleGuide } from '../styles/style-guide'; import type { Registry } from './registry/registry'; import type { AppId, AppType } from './registry/types'; import type { BreakpointId, Breakpoints, EditorContext, Entities, EntityEvent, EntitySlotMap, EntitySlotMapping, Placeholder, Subtree } from './types'; export declare class Core { readonly genId: (contentTypeId: string) => string; readonly registry: Registry; private entitySlotMap; /** * Use this when you don't care about persisting the Subtree you're building. * For example, rendering a section preview. We want to reuse the renderered * JSX, but don't care about capturing the next ID. */ static forThrowAwaySubtree(registry: Registry): Core; /** * Use this when we need to fetch the next ID from an external source. (e.g. POM#nextId) */ static fromGenerator(registry: Registry, getNextId: () => number): Core; constructor(genId: (contentTypeId: string) => string, registry: Registry); toTree(placeholder: Placeholder, parentPath?: string[]): Subtree; /** * Map to retrieve new entity ids and labels using old ids as a key * Private as it is only to be used within instance of core by contextualizeSection. Pulling out as helper fn will result in circular dep due to type of Core required for this.genId * * @param subtree * @returns an idMap using old ids as keys and new ids as values */ private generateIdMap; /** * Contextualizes a given subtree to the page by using the next available id generated by an instance of Core * e.g. next available id is 200, will use that as a starting point to populate the subtree's root id * Continues to increment id as it gets assigned to the rest of the entities in the subtree * * @param subtree * @returns a new subtree with updated ids */ contextualizeSection(subtree: Subtree, pageRootId: string): Subtree; getControl(controlId: string): import("./types").ComponentControl; getContentType(contentTypeId: string): import("./registry/types").RegistrationBundle, {}>; getContentTypeOrThrow(contentTypeId: string): import("./registry/types").RegistrationBundle, {}>; getAllHeadScripts(): import("./registry/types").RegistrationBundle, {}>[]; getAllContentTypes(): string[]; getAllTopLevelContentTypes(): string[]; getAllAppsContentEntries(): { [key: string]: string; }; getAllAppsContentOfType(type: AppType): import("./registry/types").AppRegistration>[]; getAppHook(appId: AppId): import("./registry/types").HookAppRegistration; migrateEntities(tree: Subtree): Entities; unregisterAppEntry(contentTypeId: string, tree: Subtree): Promise; replayEntityEvent(tree: Subtree, event: EntityEvent, editorContext: EditorContext, globalFallbacks: { styleGuide: StyleGuide; }, breakpointId: BreakpointId, breakpoints: Breakpoints): Subtree; addEntitySlotIdMap(entityId: string, entitySlotMap: EntitySlotMap): void; getEntitySlotIdMap(): EntitySlotMapping; }