« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/flash/FlashSide.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/flash/FlashSide.js')
-rw-r--r--src/data/things/flash/FlashSide.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/data/things/flash/FlashSide.js b/src/data/things/flash/FlashSide.js
new file mode 100644
index 00000000..5e2ea3de
--- /dev/null
+++ b/src/data/things/flash/FlashSide.js
@@ -0,0 +1,56 @@
+import {V} from '#composite';
+import Thing from '#thing';
+
+import {exposeConstant} from '#composite/control-flow';
+import {color, contentString, directory, name, soupyFind, thingList}
+  from '#composite/wiki-properties';
+
+export class FlashSide extends Thing {
+  static [Thing.referenceType] = 'flash-side';
+  static [Thing.friendlyName] = `Flash Side`;
+  static [Thing.wikiData] = 'flashSideData';
+
+  static [Thing.getPropertyDescriptors] = ({FlashAct}) => ({
+    // Update & expose
+
+    name: name(V('Unnamed Flash Side')),
+    directory: directory(),
+    color: color(),
+    listTerminology: contentString(),
+
+    acts: thingList(V(FlashAct)),
+
+    // Update only
+
+    find: soupyFind(),
+
+    // Expose only
+
+    isFlashSide: exposeConstant(V(true)),
+  });
+
+  static [Thing.yamlDocumentSpec] = {
+    fields: {
+      'Side': {property: 'name'},
+      'Directory': {property: 'directory'},
+      'Color': {property: 'color'},
+      'List Terminology': {property: 'listTerminology'},
+    },
+  };
+
+  static [Thing.findSpecs] = {
+    flashSide: {
+      referenceTypes: ['flash-side'],
+      bindTo: 'flashSideData',
+    },
+  };
+
+  static [Thing.reverseSpecs] = {
+    flashSidesWhoseActsInclude: {
+      bindTo: 'flashSideData',
+
+      referencing: flashSide => [flashSide],
+      referenced: flashSide => flashSide.acts,
+    },
+  };
+}