mirror of
https://github.com/esiur/esiur-dart.git
synced 2026-04-03 17:58:21 +00:00
1.3
This commit is contained in:
81
lib/src/Resource/Template/TemplateDescriber.dart
Normal file
81
lib/src/Resource/Template/TemplateDescriber.dart
Normal file
@@ -0,0 +1,81 @@
|
||||
import '../../Data/DataType.dart';
|
||||
|
||||
class TemplateDescriber {
|
||||
final List<Prop> properties;
|
||||
final List<Evt> events;
|
||||
final List<Func> functions;
|
||||
final String nameSpace;
|
||||
|
||||
TemplateDescriber(this.nameSpace,
|
||||
{this.properties, this.functions, this.events});
|
||||
}
|
||||
|
||||
// class Property<T> {
|
||||
// T _value;
|
||||
|
||||
// Function(T) _setter;
|
||||
// Function() _getter;
|
||||
// Function(Property) notifier;
|
||||
|
||||
// IResource resource;
|
||||
|
||||
// operator <<(other) {
|
||||
// set(other);
|
||||
// }
|
||||
|
||||
// void set(T value) {
|
||||
// if (_setter != null)
|
||||
// _setter(value);
|
||||
// else
|
||||
// _value = value;
|
||||
|
||||
// if (notifier != null) notifier.call(this);
|
||||
// }
|
||||
|
||||
// T get() {
|
||||
// if (_getter != null)
|
||||
// return _getter();
|
||||
// else
|
||||
// return _value;
|
||||
// }
|
||||
|
||||
// Property([Function() getter, Function(T) setter]) {}
|
||||
// }
|
||||
|
||||
class Prop {
|
||||
final String name;
|
||||
final Type type;
|
||||
final bool isArray;
|
||||
final String readAnnotation;
|
||||
final String writeAnnotation;
|
||||
Prop(this.name, this.type, this.isArray, [this.readAnnotation = null, this.writeAnnotation = null]);
|
||||
}
|
||||
|
||||
class Evt {
|
||||
final String name;
|
||||
final bool listenable;
|
||||
final Type type;
|
||||
final bool isArray;
|
||||
final String annotation;
|
||||
|
||||
Evt(this.name, this.type, this.isArray, [this.listenable = false, this.annotation]);
|
||||
}
|
||||
|
||||
class Func {
|
||||
final String name;
|
||||
final Type returnType;
|
||||
final List<Arg> argsType;
|
||||
final bool isArray;
|
||||
final String annotation;
|
||||
|
||||
Func(this.name, this.returnType, this.argsType, this.isArray,
|
||||
[this.annotation = null]);
|
||||
}
|
||||
|
||||
class Arg {
|
||||
final String name;
|
||||
final Type type;
|
||||
final bool isArray;
|
||||
|
||||
Arg(this.name, this.type, this.isArray);
|
||||
}
|
||||
Reference in New Issue
Block a user