umwelt-js 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +14 -5
  2. package/dist/index.js +1176 -981
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -36,10 +36,12 @@ interface ExportableUmweltNameDataSource {
36
36
  type ExportableUmweltDataSource = ExportableUmweltValuesDataSource | ExportableUmweltURLDataSource | ExportableUmweltNameDataSource;
37
37
  type UmweltPredicate = LogicalComposition<FieldPredicate>;
38
38
  declare const visualPropNames: readonly ["x", "y", "color", "shape", "size", "opacity", "order", "facet"];
39
- declare const audioPropNames: readonly ["pitch", "duration", "volume"];
39
+ declare const audioPropNames: readonly ["pitch", "duration", "volume", "pan"];
40
40
  type VisualPropName = (typeof visualPropNames)[number];
41
41
  type AudioPropName = (typeof audioPropNames)[number];
42
42
  type EncodingPropName = VisualPropName | AudioPropName;
43
+ declare const instrumentNames: readonly ["pure", "bright", "hollow", "bell", "reed", "strings"];
44
+ type InstrumentName = (typeof instrumentNames)[number];
43
45
  declare const NONE = "None";
44
46
  type FieldName = string;
45
47
  interface EncodingRef {
@@ -101,6 +103,7 @@ type AudioEncoding = {
101
103
  type AudioTraversal = AudioTraversalFieldDef[];
102
104
  type AudioUnitSpec = {
103
105
  name: string;
106
+ instrument?: InstrumentName;
104
107
  encoding: AudioEncoding;
105
108
  traversal: AudioTraversal;
106
109
  };
@@ -148,12 +151,18 @@ interface UmweltSpec {
148
151
  text: TextSpec;
149
152
  }
150
153
  type ExportableFieldDef = Omit<FieldDef, 'encodings' | 'active'>;
154
+ type ExportableVisualUnitSpec = Omit<VisualUnitSpec, 'name'> & {
155
+ name?: string;
156
+ };
157
+ type ExportableAudioUnitSpec = Omit<AudioUnitSpec, 'name'> & {
158
+ name?: string;
159
+ };
151
160
  interface ExportableVisualSpec {
152
- units: VisualUnitSpec[];
161
+ units: ExportableVisualUnitSpec[];
153
162
  composition?: ViewComposition;
154
163
  }
155
164
  interface ExportableAudioSpec {
156
- units: AudioUnitSpec[];
165
+ units: ExportableAudioUnitSpec[];
157
166
  composition?: ViewComposition;
158
167
  }
159
168
  interface ExportableTextSpec {
@@ -162,8 +171,8 @@ interface ExportableTextSpec {
162
171
  interface ExportableSpec extends Omit<UmweltSpec, 'fields' | 'data' | 'visual' | 'audio' | 'text'> {
163
172
  data: ExportableUmweltDataSource;
164
173
  fields: ExportableFieldDef[];
165
- visual: ExportableVisualSpec;
166
- audio: ExportableAudioSpec;
174
+ visual: ExportableVisualSpec | ExportableVisualUnitSpec;
175
+ audio: ExportableAudioSpec | ExportableAudioUnitSpec;
167
176
  text?: ExportableTextSpec;
168
177
  }
169
178