@msb235/blits 0.14.0 → 0.15.0

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 (173) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/README.md +3 -3
  3. package/dist/ahead.d.ts +26 -0
  4. package/dist/ahead.js +264 -0
  5. package/dist/around.d.ts +11 -0
  6. package/dist/around.js +32 -0
  7. package/dist/bare.js +15 -7
  8. package/dist/blank.d.ts +10 -0
  9. package/dist/blank.js +26 -0
  10. package/dist/blend.d.ts +2 -1
  11. package/dist/blend.js +1 -6
  12. package/dist/bound.d.ts +70 -0
  13. package/dist/bound.js +351 -0
  14. package/dist/chain.d.ts +2 -1
  15. package/dist/chain.js +7 -5
  16. package/dist/changes.d.ts +24 -0
  17. package/dist/changes.js +189 -0
  18. package/dist/channels.d.ts +39 -13
  19. package/dist/channels.js +14 -5
  20. package/dist/color.d.ts +12 -10
  21. package/dist/color.js +25 -25
  22. package/dist/columns.js +7 -3
  23. package/dist/contribution.d.ts +30 -0
  24. package/dist/contribution.js +374 -0
  25. package/dist/copyout.d.ts +10 -0
  26. package/dist/copyout.js +69 -24
  27. package/dist/crowd.d.ts +8 -2
  28. package/dist/crowd.js +4 -5
  29. package/dist/cue.d.ts +8 -1
  30. package/dist/cue.js +39 -13
  31. package/dist/cut.d.ts +8 -0
  32. package/dist/cut.js +4 -0
  33. package/dist/drop.d.ts +9 -0
  34. package/dist/drop.js +84 -0
  35. package/dist/due.d.ts +24 -5
  36. package/dist/due.js +113 -33
  37. package/dist/easing.d.ts +4 -4
  38. package/dist/easing.js +3 -3
  39. package/dist/everyone.d.ts +3 -2
  40. package/dist/everyone.js +3 -3
  41. package/dist/fade.d.ts +2 -1
  42. package/dist/fade.js +2 -1
  43. package/dist/fill.d.ts +3 -2
  44. package/dist/fill.js +51 -19
  45. package/dist/fit.d.ts +44 -26
  46. package/dist/fit.js +10 -9
  47. package/dist/fold.d.ts +4 -37
  48. package/dist/fold.js +5 -513
  49. package/dist/gather.d.ts +12 -7
  50. package/dist/gather.js +179 -44
  51. package/dist/gone.js +2 -2
  52. package/dist/grid.d.ts +47 -0
  53. package/dist/grid.js +247 -0
  54. package/dist/handle.d.ts +2 -0
  55. package/dist/handle.js +14 -8
  56. package/dist/held.d.ts +2 -1
  57. package/dist/history.d.ts +6 -5
  58. package/dist/history.js +7 -9
  59. package/dist/hosts.js +9 -15
  60. package/dist/index.d.ts +5 -4
  61. package/dist/keyfill.d.ts +1 -1
  62. package/dist/keyfill.js +5 -3
  63. package/dist/keyrows.d.ts +12 -0
  64. package/dist/keyrows.js +99 -12
  65. package/dist/lane.d.ts +36 -6
  66. package/dist/lane.js +32 -1
  67. package/dist/lanes.d.ts +23 -8
  68. package/dist/lanes.js +29 -8
  69. package/dist/leavings.d.ts +2 -2
  70. package/dist/leavings.js +1 -1
  71. package/dist/lives.d.ts +47 -0
  72. package/dist/lives.js +180 -0
  73. package/dist/meet.d.ts +2 -2
  74. package/dist/meet.js +90 -4
  75. package/dist/mixer.d.ts +54 -36
  76. package/dist/mixer.js +53 -171
  77. package/dist/motion.d.ts +14 -118
  78. package/dist/motion.js +16 -8
  79. package/dist/motions.d.ts +62 -155
  80. package/dist/motions.js +56 -370
  81. package/dist/moved.d.ts +1 -1
  82. package/dist/moved.js +16 -7
  83. package/dist/named.d.ts +0 -1
  84. package/dist/named.js +20 -2
  85. package/dist/numbers.d.ts +2 -0
  86. package/dist/numbers.js +4 -0
  87. package/dist/owed.d.ts +2 -0
  88. package/dist/owed.js +4 -0
  89. package/dist/pack.d.ts +2 -1
  90. package/dist/pack.js +2 -3
  91. package/dist/patch.d.ts +7 -3
  92. package/dist/patch.js +6 -2
  93. package/dist/places.d.ts +53 -0
  94. package/dist/places.js +171 -0
  95. package/dist/plot.d.ts +12 -0
  96. package/dist/plot.js +52 -0
  97. package/dist/project.d.ts +4 -4
  98. package/dist/project.js +9 -212
  99. package/dist/pull.js +11 -8
  100. package/dist/qualify.js +84 -21
  101. package/dist/reading.d.ts +6 -0
  102. package/dist/reading.js +5 -0
  103. package/dist/record.d.ts +5 -1
  104. package/dist/record.js +3 -2
  105. package/dist/relink.d.ts +1 -1
  106. package/dist/restored.d.ts +2 -2
  107. package/dist/restored.js +1 -1
  108. package/dist/rests.d.ts +9 -0
  109. package/dist/rests.js +76 -0
  110. package/dist/revive.d.ts +3 -2
  111. package/dist/revive.js +2 -2
  112. package/dist/{locus.d.ts → role.d.ts} +10 -9
  113. package/dist/{locus.js → role.js} +3 -3
  114. package/dist/roles.d.ts +10 -0
  115. package/dist/roles.js +158 -0
  116. package/dist/roster.js +3 -3
  117. package/dist/rotation.d.ts +1 -1
  118. package/dist/rotation.js +1 -1
  119. package/dist/rows.js +1 -1
  120. package/dist/sample.d.ts +2 -2
  121. package/dist/sample.js +33 -7
  122. package/dist/seek.js +5 -5
  123. package/dist/setting.d.ts +27 -0
  124. package/dist/setting.js +55 -0
  125. package/dist/shared.d.ts +1 -1
  126. package/dist/shared.js +1 -1
  127. package/dist/signals.d.ts +64 -32
  128. package/dist/signals.js +20 -18
  129. package/dist/stack.d.ts +5 -5
  130. package/dist/stack.js +5 -5
  131. package/dist/standing.d.ts +2 -1
  132. package/dist/standing.js +3 -2
  133. package/dist/store.d.ts +9 -0
  134. package/dist/store.js +24 -0
  135. package/dist/strays.d.ts +2 -1
  136. package/dist/strays.js +20 -13
  137. package/dist/stretch.d.ts +112 -0
  138. package/dist/stretch.js +9 -0
  139. package/dist/subject.d.ts +142 -0
  140. package/dist/subject.js +1 -0
  141. package/dist/tape.d.ts +9 -5
  142. package/dist/tape.js +5 -1
  143. package/dist/then.d.ts +9 -0
  144. package/dist/then.js +57 -0
  145. package/dist/ticker.d.ts +4 -4
  146. package/dist/transport.d.ts +0 -8
  147. package/dist/transport.js +0 -4
  148. package/dist/turns.d.ts +4 -3
  149. package/dist/turns.js +4 -3
  150. package/dist/types/arc.d.ts +12 -11
  151. package/dist/types/channel.d.ts +12 -8
  152. package/dist/types/history.d.ts +35 -19
  153. package/dist/types/mix.d.ts +222 -163
  154. package/dist/types/motion.d.ts +151 -0
  155. package/dist/types/motion.js +1 -0
  156. package/dist/types/patch.d.ts +67 -34
  157. package/dist/types/place.d.ts +51 -36
  158. package/dist/types/transport.d.ts +20 -18
  159. package/dist/types/voice.d.ts +136 -70
  160. package/dist/types/watch.d.ts +88 -40
  161. package/dist/types.d.ts +1 -0
  162. package/dist/voice.d.ts +7 -143
  163. package/dist/voice.js +28 -79
  164. package/dist/warn.d.ts +2 -0
  165. package/dist/warn.js +1 -1
  166. package/dist/watch.d.ts +2 -2
  167. package/dist/watch.js +5 -3
  168. package/dist/wave.d.ts +4 -3
  169. package/dist/wave.js +3 -2
  170. package/dist/weigh.d.ts +7 -1
  171. package/dist/weigh.js +27 -0
  172. package/docs/schema.html +212 -34
  173. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import type { VoiceSpec } from './voice.js';
2
2
  /**
3
- * What a mix or transport remembers, for `seek` and `project` to read back: see
3
+ * What a mix or transport remembers, for `seek` and `project` to read back. See
4
4
  * `MixOptions.history`.
5
5
  *
6
6
  * @category mix
@@ -17,11 +17,11 @@ export interface HistoryOptions {
17
17
  * the tape: the host bounds it.
18
18
  */
19
19
  store?: HistoryStore;
20
- /** Rebuilds a cued voice's spec from the descriptor it was cued with, so the voice can be paged out. */
20
+ /** Rebuilds a cued voice's spec from its descriptor. That lets the voice be paged out. */
21
21
  revive?(d: Described): VoiceSpec<any, any>;
22
22
  }
23
23
  /**
24
- * A voice as plain data: `kind` names what built it, and `data` survives `structuredClone`.
24
+ * A voice as plain data. `kind` names what built it, and `data` survives `structuredClone`.
25
25
  *
26
26
  * @category mix
27
27
  */
@@ -39,21 +39,23 @@ export interface HistoryStore {
39
39
  /** Records leaving memory. One brought back by a seek may be paged again: keep one per key and `seq`. */
40
40
  page(out: readonly Paged[]): void;
41
41
  /**
42
- * What a restore to mix time `t` needs, for every mix: from each stream, per voice and subject,
43
- * the latest record at or before `t` and every record after it. Returning everything is fine.
42
+ * Loads what a restore to mix time `t` needs, for every mix. That is, from each stream, per voice
43
+ * and subject, the latest record at or before `t` and every record after it. Returning
44
+ * everything is fine.
44
45
  */
45
46
  load(t: number): Promise<readonly Paged[]>;
46
47
  /**
47
- * A seek went back to frame `seq`: every record whose `seq` is greater is from a future the tape
48
- * makes again. Forget them.
48
+ * Forgets every record after frame `seq`, which a seek went back to. Every record whose `seq` is
49
+ * greater is from a future the tape makes again.
49
50
  */
50
51
  cut(seq: number): void;
51
52
  }
52
53
  /**
53
- * What a history record holds: a voice's `controls`, a stateful record's `snap`, an `input`
54
- * signal's reading, a subject's record when it `left` a voice, a motion subject's `released` run
55
- * or older `stretch`, the `host` fields patches read, a whole `voice` that has left, or the
56
- * transport's own: a `mark` announced on it, a change of its `pace`, and a `frame` it played.
54
+ * Which kind of thing a history record holds. It is a voice's `controls`, a stateful record's
55
+ * `snap`, an `input` signal's reading, a subject's record when it `left` a voice, a motion
56
+ * subject's `released` run or older `stretch`, the `host` fields patches read, a whole `voice`
57
+ * that has left, or the transport's own: a `mark` announced on it, a change of its `pace`, and a
58
+ * `frame` it played.
57
59
  *
58
60
  * @category mix
59
61
  */
@@ -64,12 +66,17 @@ export type PagedStream = 'voice' | 'snap' | 'input' | 'left' | 'released' | 'st
64
66
  * @category mix
65
67
  */
66
68
  export interface Paged {
67
- /** The mix's `name`; '' for a mix made alone without one, and for the transport's own records. */
69
+ /**
70
+ * The mix's `name`. It is '' for a mix made alone without one, and for the transport's own
71
+ * records.
72
+ */
68
73
  mix: string;
69
74
  stream: PagedStream;
70
75
  /** The voice's id, for every stream but `host` and the transport's own. */
71
76
  voice?: number;
72
- /** The subject's key, for a record of one subject; for a `mark`, the number it was announced as. */
77
+ /**
78
+ * The subject's key, for a record of one subject. For a `mark`, the number it was announced as.
79
+ */
73
80
  subject?: string | number;
74
81
  /** Mix time. */
75
82
  at: number;
@@ -81,7 +88,7 @@ export interface Paged {
81
88
  data: unknown;
82
89
  }
83
90
  /**
84
- * One host call a mix recorded on its tape: `apply` makes it again, and `invert` does nothing,
91
+ * One host call a mix recorded on its tape. `apply` makes it again, and `invert` does nothing,
85
92
  * since a mix goes back by restoring what it kept rather than by undoing calls.
86
93
  *
87
94
  * @category mix
@@ -92,8 +99,8 @@ export interface TapeOp {
92
99
  label?: string;
93
100
  }
94
101
  /**
95
- * One future a tape keeps at its current entry: the calls the host made after the mix last went
96
- * back here, before it made new ones.
102
+ * One future a tape keeps at its current entry. It holds the calls the host made after the mix
103
+ * last went back here, before it made new ones.
97
104
  *
98
105
  * @category mix
99
106
  */
@@ -126,14 +133,23 @@ export interface Tape {
126
133
  switchBranch(id: number): void;
127
134
  }
128
135
  /**
129
- * Makes a mix's tape: weasel-history's `createHistory` is one. The mix passes the clock it stamps
136
+ * Makes a mix's tape. weasel-history's `createHistory` is one. The mix passes the clock it stamps
130
137
  * calls with, branching on, so a call made after going back keeps the old future as a branch, and
131
138
  * coalescing off.
132
139
  *
133
140
  * @category mix
134
141
  */
135
- export type TapeMaker = (adapter: unknown, opts: {
142
+ export type TapeMaker = (adapter: unknown, opts: TapeOptions) => Tape;
143
+ /**
144
+ * What a mix passes its `TapeMaker` besides the adapter.
145
+ *
146
+ * @category mix
147
+ */
148
+ export interface TapeOptions {
149
+ /** The clock the tape stamps calls with. */
136
150
  now: () => number;
151
+ /** Always `true`, so a call made after going back keeps the old future as a branch. */
137
152
  branching: boolean;
153
+ /** Always `0`, which turns coalescing off. */
138
154
  coalesceWindowMs: number;
139
- }) => Tape;
155
+ }