/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * What the canvas draws (#1386): each kind's rows, as its `rows` read them, * made the entities the camera, the painter, the hit-tests and the navigator * work over — an item placed at its centre, a zone, a link between two items, * a net joining many to many. Each is named on the canvas by its reference, * printed (`entityId`): its kind's slot and its key, so two kinds' rows of one * key are two entities. A link's ends and a net's sides name their items so. * An item's card draws its details' status, bar, figure and second line where * its kind gives none — and, while its details row is read, a placeholder in * each one's place (#1398): never a value it has not read. React-free data in, * data out, unit-tested in `drawn.test.ts`. * * @packageDocumentation */ import { ArrayType, FloatType, OptionType, StringType, StructType, type ValueTypeOf } from "@elaraai/east"; declare const T: import("@elaraai/e3-ui/internal").SchematicTypes & { Payload: typeof import("@elaraai/e3-ui/internal").SchematicPayloadType; ItemKind: typeof import("@elaraai/e3-ui/internal").SchematicItemKindType; ZoneKind: typeof import("@elaraai/e3-ui/internal").SchematicZoneKindType; LinkKind: typeof import("@elaraai/e3-ui/internal").SchematicLinkKindType; NetKind: typeof import("@elaraai/e3-ui/internal").SchematicNetKindType; Details: typeof import("@elaraai/e3-ui/internal").SchematicKindDetailsType; DetailsRoles: typeof import("@elaraai/e3-ui/internal").SchematicDetailsRolesType; CardRoles: typeof import("@elaraai/e3-ui/internal").SchematicCardRolesType; ItemEntry: typeof import("@elaraai/e3-ui/internal").SchematicItemEntryType; ZoneEntry: typeof import("@elaraai/e3-ui/internal").SchematicZoneEntryType; LinkEntry: typeof import("@elaraai/e3-ui/internal").SchematicLinkEntryType; NetEntry: typeof import("@elaraai/e3-ui/internal").SchematicNetEntryType; DetailsEntry: typeof import("@elaraai/e3-ui/internal").SchematicDetailsEntryType; Ends: typeof import("@elaraai/e3-ui/internal").SchematicEndsType; Sides: typeof import("@elaraai/e3-ui/internal").SchematicSidesType; Template: typeof import("@elaraai/e3-ui/internal").SchematicTemplateType; Narrowed: typeof import("@elaraai/e3-ui/internal").SchematicNarrowedType; LibraryTab: typeof import("@elaraai/e3-ui/internal").SchematicLibraryTabType; }; /** * An item as the canvas draws it: placed at its centre, named by its reference * printed. * * @property key - Its id on the canvas: its reference, printed * @property ref - Its kind's slot and its key * @property pending - Which of its card's roles its details give, while its details row is read: each a placeholder in * its place (#1398); `none` once it is read, and for a kind with no details */ export declare const SchematicDrawnItemType: StructType<{ readonly key: StringType; readonly ref: StructType<{ readonly kind: StringType; readonly key: StringType; }>; readonly x: FloatType; readonly y: FloatType; readonly label: StringType; readonly sublabel: OptionType; readonly icon: OptionType; readonly status: OptionType; readonly ring: import("@elaraai/east").BooleanType; }>>; readonly meter: OptionType>; readonly metric: OptionType; readonly width: OptionType; readonly height: OptionType; readonly footprint: OptionType; readonly polyline: StructType<{ readonly vertices: ArrayType>; readonly width: OptionType; }>; readonly polygon: StructType<{ readonly vertices: ArrayType>; }>; }>>; readonly tone: OptionType>; readonly color: OptionType; readonly fillOpacity: OptionType; readonly weight: OptionType; readonly layer: OptionType; readonly pending: OptionType>; }>; /** * A zone as the canvas draws it. * * @property key - Its id on the canvas: its reference, printed * @property ref - Its kind's slot and its key */ export declare const SchematicDrawnZoneType: StructType<{ readonly key: StringType; readonly ref: StructType<{ readonly kind: StringType; readonly key: StringType; }>; readonly label: StringType; readonly x: FloatType; readonly y: FloatType; readonly width: FloatType; readonly height: FloatType; readonly pattern: import("@elaraai/east").VariantType<{ readonly outline: StructType<{ readonly tone: OptionType>; }>; readonly hatch: StructType<{ readonly tone: OptionType>; readonly spacing: OptionType; readonly angle: OptionType; }>; }>; readonly geometry: OptionType; readonly polyline: StructType<{ readonly vertices: ArrayType>; readonly width: OptionType; }>; readonly polygon: StructType<{ readonly vertices: ArrayType>; }>; }>>; readonly tone: OptionType>; readonly color: OptionType; readonly fillOpacity: OptionType; readonly weight: OptionType; readonly layer: OptionType; }>; /** * A link as the canvas draws it: its ends the ids of the items it joins. * * @property key - Its id on the canvas: its reference, printed * @property ref - Its kind's slot and its key * @property from - The id of the item it runs from * @property to - The id of the item it runs to */ export declare const SchematicDrawnLinkType: StructType<{ readonly key: StringType; readonly ref: StructType<{ readonly kind: StringType; readonly key: StringType; }>; readonly from: StringType; readonly to: StringType; readonly label: OptionType; readonly metric: OptionType; readonly style: import("@elaraai/east").VariantType<{ readonly solid: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; readonly dashed: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; }>; readonly route: import("@elaraai/east").VariantType<{ readonly orthogonal: StructType<{ readonly corner: OptionType; }>; readonly direct: import("@elaraai/east").NullType; }>; readonly via: ArrayType>; readonly layer: OptionType; }>; /** * A net as the canvas draws it: its sides the ids of the items it joins. * * @property key - Its id on the canvas: its reference, printed * @property ref - Its kind's slot and its key * @property sources - The ids of the items on its feeding side * @property destinations - The ids of the items on its fed side */ export declare const SchematicDrawnNetType: StructType<{ readonly key: StringType; readonly ref: StructType<{ readonly kind: StringType; readonly key: StringType; }>; readonly sources: ArrayType; readonly destinations: ArrayType; readonly label: OptionType; readonly metric: OptionType; readonly style: import("@elaraai/east").VariantType<{ readonly solid: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; readonly dashed: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; }>; readonly route: import("@elaraai/east").VariantType<{ readonly orthogonal: StructType<{ readonly corner: OptionType; }>; readonly direct: import("@elaraai/east").NullType; }>; readonly via: ArrayType>; readonly layer: OptionType; }>; /** * Everything the canvas draws: its items, zones, links and nets, each kind's * in the order the Schematic lists its kinds, each kind's in key order. */ export declare const SchematicDrawnType: StructType<{ readonly items: ArrayType; readonly x: FloatType; readonly y: FloatType; readonly label: StringType; readonly sublabel: OptionType; readonly icon: OptionType; readonly status: OptionType; readonly ring: import("@elaraai/east").BooleanType; }>>; readonly meter: OptionType>; readonly metric: OptionType; readonly width: OptionType; readonly height: OptionType; readonly footprint: OptionType; readonly polyline: StructType<{ readonly vertices: ArrayType>; readonly width: OptionType; }>; readonly polygon: StructType<{ readonly vertices: ArrayType>; }>; }>>; readonly tone: OptionType>; readonly color: OptionType; readonly fillOpacity: OptionType; readonly weight: OptionType; readonly layer: OptionType; readonly pending: OptionType>; }>>; readonly zones: ArrayType; readonly label: StringType; readonly x: FloatType; readonly y: FloatType; readonly width: FloatType; readonly height: FloatType; readonly pattern: import("@elaraai/east").VariantType<{ readonly outline: StructType<{ readonly tone: OptionType>; }>; readonly hatch: StructType<{ readonly tone: OptionType>; readonly spacing: OptionType; readonly angle: OptionType; }>; }>; readonly geometry: OptionType; readonly polyline: StructType<{ readonly vertices: ArrayType>; readonly width: OptionType; }>; readonly polygon: StructType<{ readonly vertices: ArrayType>; }>; }>>; readonly tone: OptionType>; readonly color: OptionType; readonly fillOpacity: OptionType; readonly weight: OptionType; readonly layer: OptionType; }>>; readonly links: ArrayType; readonly from: StringType; readonly to: StringType; readonly label: OptionType; readonly metric: OptionType; readonly style: import("@elaraai/east").VariantType<{ readonly solid: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; readonly dashed: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; }>; readonly route: import("@elaraai/east").VariantType<{ readonly orthogonal: StructType<{ readonly corner: OptionType; }>; readonly direct: import("@elaraai/east").NullType; }>; readonly via: ArrayType>; readonly layer: OptionType; }>>; readonly nets: ArrayType; readonly sources: ArrayType; readonly destinations: ArrayType; readonly label: OptionType; readonly metric: OptionType; readonly style: import("@elaraai/east").VariantType<{ readonly solid: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; readonly dashed: StructType<{ readonly tone: OptionType>; readonly weight: OptionType; }>; }>; readonly route: import("@elaraai/east").VariantType<{ readonly orthogonal: StructType<{ readonly corner: OptionType; }>; readonly direct: import("@elaraai/east").NullType; }>; readonly via: ArrayType>; readonly layer: OptionType; }>>; }>; /** An item as the canvas draws it. */ export type DrawnItem = ValueTypeOf; /** A zone as the canvas draws it. */ export type DrawnZone = ValueTypeOf; /** A link as the canvas draws it. */ export type DrawnLink = ValueTypeOf; /** A net as the canvas draws it. */ export type DrawnNet = ValueTypeOf; /** Everything the canvas draws. */ export type SchematicDrawn = ValueTypeOf; /** An entity's reference: its kind's slot and its key. */ export type SchematicRef = ValueTypeOf; /** An item's roles, as its kind's `rows` give them. */ export type ItemRoles = ValueTypeOf; /** A zone's roles. */ export type ZoneRoles = ValueTypeOf; /** A link's roles. */ export type LinkRoles = ValueTypeOf; /** A net's roles. */ export type NetRoles = ValueTypeOf; /** A details row's roles. */ export type DetailsRoles = ValueTypeOf; /** Which of a card's roles its kind's details give. */ export type CardRoles = ValueTypeOf; /** Nothing drawn: a Schematic whose reads have not landed. */ export declare const EMPTY_DRAWN: SchematicDrawn; /** An entity's id on the canvas: its reference, as East prints it — its kind's slot and its key. */ export declare const entityId: (ref: SchematicRef) => string; /** * An entity's reference from its id on the canvas: what {@link entityId} * printed, read back — a link's end, a net's member, by the id it draws under. * * @param id - The entity's id * @returns Its reference; `undefined` for text no reference prints as */ export declare function refOfId(id: string): SchematicRef | undefined; /** * An item as the canvas draws it, from its roles and its details' roles; none * for a row with no position, which is its kind's backlog and never draws. * * @param ref - Its kind's slot and its key * @param roles - Its roles * @param details - Its details row's roles, if its kind has details and the row has one * @param pending - The card roles its kind's details give, while its details row is read: its card draws a placeholder in each one's place (#1398) * @returns The item, or `undefined` for an unplaced row */ export declare function drawnItem(ref: SchematicRef, roles: ItemRoles, details: DetailsRoles | undefined, pending?: CardRoles): DrawnItem | undefined; /** * Whether an item's colour is its status's, and its status unread (#1398): its * details give its status, their row is read, and the item has no colour of * its own — its marker and its card's dot draw a placeholder, never a status. * * @param item - The item * @returns Whether its status is unread */ export declare function statusUnread(item: DrawnItem): boolean; /** * A zone as the canvas draws it, from its roles. * * @param ref - Its kind's slot and its key * @param roles - Its roles * @returns The zone */ export declare function drawnZone(ref: SchematicRef, roles: ZoneRoles): DrawnZone; /** * A link as the canvas draws it, from its roles: its ends the ids of the items * it joins. * * @param ref - Its kind's slot and its key * @param roles - Its roles * @returns The link */ export declare function drawnLink(ref: SchematicRef, roles: LinkRoles): DrawnLink; /** * A net as the canvas draws it, from its roles: its sides the ids of the * items it joins. * * @param ref - Its kind's slot and its key * @param roles - Its roles * @returns The net */ export declare function drawnNet(ref: SchematicRef, roles: NetRoles): DrawnNet; export {}; //# sourceMappingURL=drawn.d.ts.map