Browse Source

docs(dynamite_runtime): document content string

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/854/head
Nikolas Rimikis 1 year ago
parent
commit
cdb9fa0588
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 11
      packages/dynamite/dynamite_runtime/lib/src/content_string.dart

11
packages/dynamite/dynamite_runtime/lib/src/content_string.dart

@ -5,17 +5,26 @@ import 'package:built_value/serializer.dart';
part 'content_string.g.dart'; part 'content_string.g.dart';
/// Json data encoded in a `String` as defined by [json-schema](https://json-schema.org/understanding-json-schema/reference/non_json_data.html#contentschema).
abstract class ContentString<T> implements Built<ContentString<T>, ContentStringBuilder<T>> { abstract class ContentString<T> implements Built<ContentString<T>, ContentStringBuilder<T>> {
/// Creates a new content `String`.
factory ContentString([final void Function(ContentStringBuilder<T>)? b]) = _$ContentString<T>; factory ContentString([final void Function(ContentStringBuilder<T>)? b]) = _$ContentString<T>;
const ContentString._(); const ContentString._();
/// decoded contentString /// The decoded value of the content `String`.
T get content; T get content;
/// The serializer for a content `String`.
static Serializer<ContentString<Object?>> get serializer => _$contentStringSerializer; static Serializer<ContentString<Object?>> get serializer => _$contentStringSerializer;
} }
/// Serialization plugin for decoding [ContentString]s.
///
/// This plugin must be after the `StandardJsonPlugin`.
class ContentStringPlugin implements SerializerPlugin { class ContentStringPlugin implements SerializerPlugin {
/// Creates a new serialization plugin for decoding [ContentString]s.
///
/// This plugin must be after the `StandardJsonPlugin`.
const ContentStringPlugin(); const ContentStringPlugin();
@override @override

Loading…
Cancel
Save