Skip to content

Commit

Permalink
Move implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Craftplacer committed Nov 7, 2024
1 parent 2351cfb commit 1f569f3
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/sane/example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void main(List<String> args) async {
print('${record.level.name}: ${record.time}: ${record.message}');
});

final sane = SaneIsolate(sane: SaneDev());
final sane = SaneNative(sane: SaneDev());
await sane.spawn();

await sane.init();
Expand Down
6 changes: 3 additions & 3 deletions packages/sane/lib/sane.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
library;

export 'src/exceptions.dart';
export 'src/sane_dev.dart';
export 'src/sane_native.dart';
export 'src/sane_sync.dart';
export 'src/impl/sane_dev.dart';
export 'src/impl/sane_native.dart';
export 'src/impl/sane_sync.dart';
export 'src/structures.dart';
export 'src/utils.dart';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import 'package:sane/src/isolate_messages/read.dart';
import 'package:sane/src/isolate_messages/set_io_mode.dart';
import 'package:sane/src/isolate_messages/start.dart';

class SaneIsolate implements Sane {
SaneIsolate({
class SaneNative implements Sane {
SaneNative({
required Sane sane,
}) : _sane = sane;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/cancel.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class CancelMessage implements IsolateMessage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class ControlButtonOptionMessage
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/control_option.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class ControlValueOptionMessage<T>
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/exit.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';

class ExitMessage implements IsolateMessage {
@override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class GetAllOptionDescriptorsMessage
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/get_devices.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class GetDevicesMessage implements IsolateMessage<GetDevicesResponse> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class GetOptionDescriptorMessage
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/get_parameters.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class GetParametersMessage implements IsolateMessage<GetParametersResponse> {
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/init.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';

class InitMessage implements IsolateMessage<InitResponse> {
@override
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/interface.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/impl/sane_sync.dart';

abstract interface class IsolateMessage<T extends IsolateResponse> {
Future<T> handle(Sane sane);
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/open.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class OpenMessage implements IsolateMessage<OpenResponse> {
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/read.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:typed_data';

import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class ReadMessage implements IsolateMessage<ReadResponse> {
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/set_io_mode.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class SetIOModeMessage implements IsolateMessage {
Expand Down
2 changes: 1 addition & 1 deletion packages/sane/lib/src/isolate_messages/start.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:sane/src/impl/sane_sync.dart';
import 'package:sane/src/isolate_messages/interface.dart';
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/structures.dart';

class StartMessage implements IsolateMessage {
Expand Down
5 changes: 2 additions & 3 deletions packages/sane/test/sane_test.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:sane/src/sane_sync.dart';
import 'package:sane/src/impl/sane_sync.dart';
import 'package:test/test.dart';

void main() {
test('Sane init test', () {
final sane = Sane();
expect(sane.init, returnsNormally);
expect(Sane.new, returnsNormally);
});
}

0 comments on commit 1f569f3

Please sign in to comment.