onManifest method

void onManifest(
  1. FutureOr<GeneratorManifest?> handler(
    1. GeneratorConfig config
    )
)

Implementation

void onManifest(
  FutureOr<GeneratorManifest?> Function(GeneratorConfig config) handler,
) {
  server.registerMethod('getManifest', (Parameters params) async {
    final config = GeneratorConfig.fromJson(params.asMap.cast());
    final manifest = await handler(config);

    return {'manifest': manifest?.toJson()};
  });
}