import { edgeLabel } from "./decorationFactories"; import { createShapeLabelPolicy } from "./shapeLabelPolicy"; export type ShapeLabelHelpers = Readonly<{ edgeLabel: typeof edgeLabel; createShapeLabelPolicy: typeof createShapeLabelPolicy; }>; /** * Build-your-own hook: stable references to shape edge-label primitives. * * Returns `edgeLabel` and `createShapeLabelPolicy` for consumers building * custom shape layers that need edge-label decorations and the annotation-opt-in * coupling described in ADR-0017, without reimplementing the placement logic. * * Named `useShapeLabelHelpers` to distinguish it from the existing * `useShapeDecorations` internal hook. * * @example * ```tsx * const { edgeLabel, createShapeLabelPolicy } = useShapeLabelHelpers(); * const policy = useMemo(() => createShapeLabelPolicy({ * annotateWhen: (_f, ctx) => ctx.isViewportInsideShape, * resolve: (_f, ctx) => ctx.isSelected ? "force" : "auto", * }), [createShapeLabelPolicy]); * * // Inside getDecorations: * getDecorations: (feature) => [edgeLabel(feature.properties?.name)], * ``` */ export declare const useShapeLabelHelpers: () => ShapeLabelHelpers;