Skip to content

Commit

Permalink
refactor and update export
Browse files Browse the repository at this point in the history
  • Loading branch information
shiosyakeyakini-info committed Aug 10, 2024
1 parent 3f01934 commit 29dea84
Show file tree
Hide file tree
Showing 4 changed files with 494 additions and 447 deletions.
1 change: 1 addition & 0 deletions lib/misskey_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export 'src/data/streaming/home_timeline_parameter.dart';
export 'src/data/streaming/local_timeline_parameter.dart';
export 'src/data/streaming/global_timeline_parameter.dart';
export 'src/data/streaming/hybrid_timeline_parameter.dart';
export 'src/data/streaming/streaming_response.dart';
export 'src/data/join_misskey_instances.dart';
export 'src/services/streaming_service.dart';
export 'src/server.dart';
Expand Down
20 changes: 10 additions & 10 deletions lib/src/data/streaming/streaming_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ sealed class ChannelStreamEvent with _$ChannelStreamEvent {
required String id,
@ChannelEventTypeJsonConverter() required ChannelEventType type,
required Note body,
}) = NoteChannel;
}) = NoteChannelEvent;

@FreezedUnionValue("statsLog")
const factory ChannelStreamEvent.statsLog({
required String id,
required List<StatsLogResponse> body,
}) = StatsLog;
}) = StatsLogChannelEvent;

@FreezedUnionValue("stats")
const factory ChannelStreamEvent.stats({
required String id,
required StatsLogResponse body,
}) = Stats;
}) = StatsChannelEvent;

@FreezedUnionValue("queueStats")
const factory ChannelStreamEvent.queueStats({
required String id,
required List<QueueStatsLogResponse> body,
}) = QueueStats;
}) = QueueStatsChannelEvent;

//TODO: queueとstatsって一緒?

Expand All @@ -76,31 +76,31 @@ sealed class NoteUpdateStreamEvent with _$NoteUpdateStreamEvent {
const factory NoteUpdateStreamEvent.reacted({
required String id,
required TimelineReacted body,
}) = Reacted;
}) = ReactedChannelEvent;

@FreezedUnionValue("unreacted")
const factory NoteUpdateStreamEvent.unreacted({
required String id,
required TimelineReacted body,
}) = Unreacted;
}) = UnreactedChannelEvent;

@FreezedUnionValue("deleted")
const factory NoteUpdateStreamEvent.deleted({
required String id,
required DateTime deletedAt,
}) = _Deleted;
}) = _DeletedChannelEvent;

@FreezedUnionValue("pollVoted")
const factory NoteUpdateStreamEvent.pollVoted({
required String id,
required TimelineVoted voted,
}) = _PollVoted;
}) = _PollVotedChannelEvent;

@FreezedUnionValue("updated")
const factory NoteUpdateStreamEvent.updated({
required String id,
required NoteEdited edited,
}) = Updated;
}) = UpdatedChannelEvent;

factory NoteUpdateStreamEvent.fromJson(Map<String, dynamic> json) =>
_$NoteUpdateStreamEventFromJson(json);
Expand All @@ -111,7 +111,7 @@ sealed class BroadcastStreamEvent with _$BroadcastStreamEvent {
const factory BroadcastStreamEvent.broadcast({
@BroadcastEventTypeJsonConverter() required BroadcastEventType type,
required Map<String, dynamic> body,
}) = Broadcast;
}) = BroadcastChannelEvent;

factory BroadcastStreamEvent.fromJson(Map<String, dynamic> json) =>
_$BroadcastStreamEventFromJson(json);
Expand Down
Loading

0 comments on commit 29dea84

Please sign in to comment.