import type { AnnotationRendererKind, AnnotationRendererOfKind } from "#types/annotation-renderer"; import type { MediaRendererPresentation } from "#types/media-rendering"; /** The style contract configured by one renderer kind. */ export declare const styledAnnotationRendererKinds: readonly ["box", "box-corners", "ellipse", "keypoints", "label", "mask", "maskHalo", "marker", "orientedBox", "percentageBar", "polygon", "polyline"]; export type StyledAnnotationRendererKind = (typeof styledAnnotationRendererKinds)[number]; export type AnnotationRendererStyle = NonNullable["style"]>; /** * The presentation field that carries a renderer kind's style. * * The pairing is derived from the style contracts themselves, so a registry * entry that points a kind at the wrong presentation field does not compile. */ export type AnnotationRendererStyleFieldFor = { [TField in keyof MediaRendererPresentation]-?: AnnotationRendererStyle extends NonNullable ? NonNullable extends AnnotationRendererStyle ? TField : never : never; }[keyof MediaRendererPresentation]; /** Every presentation field owned by a built-in renderer kind. */ export type AnnotationRendererStyleField = { [TKind in StyledAnnotationRendererKind]: AnnotationRendererStyleFieldFor; }[StyledAnnotationRendererKind]; export interface AnnotationRendererKindMetadata { readonly cardinality: "singleton"; /** Presentation field this kind reads its configured style from. */ readonly styleField: AnnotationRendererStyleFieldFor; /** * Builds this kind's canonical default style on demand, so resolving one * listed renderer never constructs the styles of the other kinds. */ readonly createCanonicalStyle: () => AnnotationRendererStyle; } export interface DirectAnnotationRendererKindMetadata { readonly cardinality: "multiple"; } /** * The single source of built-in renderer presentation metadata. * * Adding a kind to {@link annotationRendererKinds} without a complete entry * here is a compile error, and every consumer of renderer metadata reads this * registry instead of repeating the kind-to-style mapping. */ export type AnnotationRendererRegistry = { readonly [TKind in AnnotationRendererKind]: TKind extends StyledAnnotationRendererKind ? AnnotationRendererKindMetadata : DirectAnnotationRendererKindMetadata; }; export declare const annotationRendererRegistry: AnnotationRendererRegistry; export declare function isStyleBackedAnnotationRendererKind(kind: AnnotationRendererKind): kind is StyledAnnotationRendererKind; /** Presentation fields owned by the given renderer kinds, in the same order. */ export declare function resolveAnnotationRendererStyleFields(kinds: readonly AnnotationRendererKind[]): readonly AnnotationRendererStyleField[]; //# sourceMappingURL=annotation-renderer-registry.d.ts.map