[TypeDef] Place all typedefs on the top

This commit is contained in:
Christian Pauly 2019-09-02 10:33:32 +02:00
parent 2802901eec
commit dddc9a23c6
4 changed files with 12 additions and 12 deletions

View File

@ -37,6 +37,9 @@ import 'requests/SetPushersRequest.dart';
import 'responses/ErrorResponse.dart'; import 'responses/ErrorResponse.dart';
import 'responses/PushrulesResponse.dart'; import 'responses/PushrulesResponse.dart';
typedef AccountDataEventCB = void Function(AccountData accountData);
typedef PresenceCB = void Function(Presence presence);
/// Represents a Matrix client to communicate with a /// Represents a Matrix client to communicate with a
/// [Matrix](https://matrix.org) homeserver and is the entry point for this /// [Matrix](https://matrix.org) homeserver and is the entry point for this
/// SDK. /// SDK.
@ -338,6 +341,3 @@ class Client {
return resp; return resp;
} }
} }
typedef AccountDataEventCB = void Function(AccountData accountData);
typedef PresenceCB = void Function(Presence presence);

View File

@ -473,6 +473,8 @@ class Connection {
} }
} }
typedef _FutureVoidCallback = Future<void> Function();
class _LifecycleEventHandler extends WidgetsBindingObserver { class _LifecycleEventHandler extends WidgetsBindingObserver {
_LifecycleEventHandler({this.resumeCallBack, this.suspendingCallBack}); _LifecycleEventHandler({this.resumeCallBack, this.suspendingCallBack});
@ -494,6 +496,4 @@ class _LifecycleEventHandler extends WidgetsBindingObserver {
} }
} }
typedef _FutureVoidCallback = Future<void> Function();
enum LoginState { logged, loggedOut } enum LoginState { logged, loggedOut }

View File

@ -32,6 +32,10 @@ import 'User.dart';
import 'sync/EventUpdate.dart'; import 'sync/EventUpdate.dart';
import 'sync/RoomUpdate.dart'; import 'sync/RoomUpdate.dart';
typedef onRoomListUpdateCallback = void Function();
typedef onRoomListInsertCallback = void Function(int insertID);
typedef onRoomListRemoveCallback = void Function(int insertID);
/// Represents a list of rooms for this client, which will automatically update /// Represents a list of rooms for this client, which will automatically update
/// itself and call the [onUpdate], [onInsert] and [onDelete] callbacks. To get /// itself and call the [onUpdate], [onInsert] and [onDelete] callbacks. To get
/// the initial room list, use the store or create a RoomList instance by using /// the initial room list, use the store or create a RoomList instance by using
@ -167,7 +171,3 @@ class RoomList {
if (onUpdate != null) onUpdate(); if (onUpdate != null) onUpdate();
} }
} }
typedef onRoomListUpdateCallback = void Function();
typedef onRoomListInsertCallback = void Function(int insertID);
typedef onRoomListRemoveCallback = void Function(int insertID);

View File

@ -28,6 +28,9 @@ import 'Room.dart';
import 'User.dart'; import 'User.dart';
import 'sync/EventUpdate.dart'; import 'sync/EventUpdate.dart';
typedef onTimelineUpdateCallback = void Function();
typedef onTimelineInsertCallback = void Function(int insertID);
/// Represents the timeline of a room. The callbacks [onUpdate], [onDelete], /// Represents the timeline of a room. The callbacks [onUpdate], [onDelete],
/// [onInsert] and [onResort] will be triggered automatically. The initial /// [onInsert] and [onResort] will be triggered automatically. The initial
/// event list will be retreived when created by the [room.getTimeline] method. /// event list will be retreived when created by the [room.getTimeline] method.
@ -102,6 +105,3 @@ class Timeline {
if (onUpdate != null) onUpdate(); if (onUpdate != null) onUpdate();
} }
} }
typedef onTimelineUpdateCallback = void Function();
typedef onTimelineInsertCallback = void Function(int insertID);