import type { RTP } from "./RecordTypes"; import { RT } from "./RecordTypes"; export interface RecordNode { /** * To tell us which factory method can be used to process this json. * Allows strings too to directly accept jsons (else jsons give this error: "Type 'string' is not assignable to type 'RecordType.project'") */ type: T | string; order?: number; name?: string; /** properties. Ideally don't store id,name,type again inside (note: this type is not element_type) */ props: Partial>; /** children. A map of named collections */ records?: Partial>>; } export type RecordMap = Record>; export type RecordMapGeneric = Record>; /** * Creates an object of any of the known record types * name is optional - used only in case this rcord type needs a name. In case not given, can also use once from rt definitions. * order to not assigned to this record - as it doesn't make sense right. It will automatically get once, once this record enters the main tree */ export declare const createRecord: (type: T, name?: string) => RecordNode; /** id: child id, r: child RecordNode, p: parent RecordNode */ export type rAndP = { id: number; r: RecordNode; p: RecordNode; }; export type idAndRecord = { id: number; record: RecordNode; }; export type idOrAddress = number | string; export type RecordEntry = [number, RecordNode]; /** clipboard contains the strigified version of this */ export interface ClipboardData { nodes: idAndRecord[]; }