Skip to content

Commit

Permalink
docs(dynamite_runtime): document content string
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolas Rimikis <[email protected]>
  • Loading branch information
Leptopoda committed Sep 26, 2023
1 parent f0326fb commit cdb9fa0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/dynamite/dynamite_runtime/lib/src/content_string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@ import 'package:built_value/serializer.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>> {
/// Creates a new content `String`.
factory ContentString([final void Function(ContentStringBuilder<T>)? b]) = _$ContentString<T>;
const ContentString._();

/// decoded contentString
/// The decoded value of the content `String`.
T get content;

/// The serializer for a content `String`.
static Serializer<ContentString<Object?>> get serializer => _$contentStringSerializer;
}

/// Serialization plugin for decoding [ContentString]s.
///
/// This plugin must be after the `StandardJsonPlugin`.
class ContentStringPlugin implements SerializerPlugin {
/// Creates a new serialization plugin for decoding [ContentString]s.
///
/// This plugin must be after the `StandardJsonPlugin`.
const ContentStringPlugin();

@override
Expand Down

0 comments on commit cdb9fa0

Please sign in to comment.