AnnotationManagerTyped extension
Typed convenience layer over the JSON transport on AnnotationManagerInterface.
These wrap the *Json methods and parse Instant JSON into the typed
Annotation models. They are platform-agnostic: at the getAnnotationsJson
boundary all platforms emit spec Instant JSON. Parsing is defensive
(Annotation.tryFromJson) so one malformed annotation never fails a page.
Implemented as an extension (not default methods) because the platform
managers implements the interface; a custom adapter customizes behavior by
overriding the *Json transport methods, which these delegate to.
See documentation/typed-annotations-cross-platform.md.
Methods
-
addAnnotation(
Annotation annotation) → Future< Annotation?> -
Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension
Adds a typedannotationto the document. -
getAnnotations(
int pageIndex, [AnnotationType type = AnnotationType.all]) → Future< List< Annotation> > -
Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension
Returns the typed annotations onpageIndex, optionally filtered bytype(defaults to all types). -
getUnsavedAnnotations(
) → Future< List< Annotation> > -
Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension
Returns the typed annotations that have unsaved changes. -
searchAnnotations(
String query, {int? pageIndex}) → Future< List< Annotation> > -
Available on AnnotationManagerInterface, provided by the AnnotationManagerTyped extension
Searches annotations byquery, returning typed results.