wasm work
This commit is contained in:
@@ -9,95 +9,6 @@ import 'dart:typed_data';
|
||||
|
||||
import 'veilid_encoding.dart';
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// WASM Platform-specific config
|
||||
|
||||
class VeilidWASMConfigLoggingPerformance {
|
||||
bool enabled;
|
||||
VeilidConfigLogLevel level;
|
||||
bool logsInTimings;
|
||||
bool logsInConsole;
|
||||
|
||||
VeilidWASMConfigLoggingPerformance({
|
||||
required this.enabled,
|
||||
required this.level,
|
||||
required this.logsInTimings,
|
||||
required this.logsInConsole,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'enabled': enabled,
|
||||
'level': level.toJson(),
|
||||
'logs_in_timings': logsInTimings,
|
||||
'logs_in_console': logsInConsole,
|
||||
};
|
||||
}
|
||||
|
||||
VeilidWASMConfigLoggingPerformance.fromJson(dynamic json)
|
||||
: enabled = json['enabled'],
|
||||
level = veilidConfigLogLevelFromJson(json['level']),
|
||||
logsInTimings = json['logs_in_timings'],
|
||||
logsInConsole = json['logs_in_console'];
|
||||
}
|
||||
|
||||
class VeilidWASMConfigLoggingApi {
|
||||
bool enabled;
|
||||
VeilidConfigLogLevel level;
|
||||
|
||||
VeilidWASMConfigLoggingApi({
|
||||
required this.enabled,
|
||||
required this.level,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'enabled': enabled,
|
||||
'level': level.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
VeilidWASMConfigLoggingApi.fromJson(dynamic json)
|
||||
: enabled = json['enabled'],
|
||||
level = veilidConfigLogLevelFromJson(json['level']);
|
||||
}
|
||||
|
||||
class VeilidWASMConfigLogging {
|
||||
VeilidWASMConfigLoggingPerformance performance;
|
||||
VeilidWASMConfigLoggingApi api;
|
||||
|
||||
VeilidWASMConfigLogging({required this.performance, required this.api});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'performance': performance.toJson(),
|
||||
'api': api.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
VeilidWASMConfigLogging.fromJson(dynamic json)
|
||||
: performance =
|
||||
VeilidWASMConfigLoggingPerformance.fromJson(json['performance']),
|
||||
api = VeilidWASMConfigLoggingApi.fromJson(json['api']);
|
||||
}
|
||||
|
||||
class VeilidWASMConfig {
|
||||
VeilidWASMConfigLogging logging;
|
||||
|
||||
VeilidWASMConfig({
|
||||
required this.logging,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'logging': logging.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
VeilidWASMConfig.fromJson(dynamic json)
|
||||
: logging = VeilidWASMConfigLogging.fromJson(json['logging']);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
Veilid getVeilid() => VeilidJS();
|
||||
|
||||
Reference in New Issue
Block a user