@popcraft/kit 0.1.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 (171) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +74 -0
  4. package/dist/index.js +160558 -0
  5. package/package.json +40 -0
  6. package/types/design-script.d.ts +39 -0
  7. package/types/lib/agent/design-script/build.d.ts +35 -0
  8. package/types/lib/agent/design-script/check.d.ts +11 -0
  9. package/types/lib/agent/design-script/helper-names.d.ts +1 -0
  10. package/types/lib/agent/design-script/kit-modules.d.ts +43 -0
  11. package/types/lib/agent/design-script/recorder.d.ts +52 -0
  12. package/types/lib/agent/design-script/replay.d.ts +13 -0
  13. package/types/lib/agent/design-script/run-node.d.ts +2 -0
  14. package/types/lib/ai/audio-models.d.ts +66 -0
  15. package/types/lib/ai/content.d.ts +27 -0
  16. package/types/lib/ai/limits.d.ts +42 -0
  17. package/types/lib/audio/presentation/loudness.d.ts +80 -0
  18. package/types/lib/audio/presentation/types.d.ts +112 -0
  19. package/types/lib/brand/apply.d.ts +25 -0
  20. package/types/lib/brand/review-kits.d.ts +10 -0
  21. package/types/lib/brand/types.d.ts +20 -0
  22. package/types/lib/code/hash.d.ts +2 -0
  23. package/types/lib/document/auto-layout.d.ts +10 -0
  24. package/types/lib/document/breakpoints.d.ts +45 -0
  25. package/types/lib/document/clone.d.ts +6 -0
  26. package/types/lib/document/color.d.ts +52 -0
  27. package/types/lib/document/detach.d.ts +12 -0
  28. package/types/lib/document/effects.d.ts +60 -0
  29. package/types/lib/document/expressions.d.ts +78 -0
  30. package/types/lib/document/instance-layout.d.ts +94 -0
  31. package/types/lib/document/instances.d.ts +63 -0
  32. package/types/lib/document/libraries.d.ts +97 -0
  33. package/types/lib/document/node-delta.d.ts +21 -0
  34. package/types/lib/document/page-tokens.d.ts +16 -0
  35. package/types/lib/document/photo-frames.d.ts +14 -0
  36. package/types/lib/document/print-pages.d.ts +85 -0
  37. package/types/lib/document/scene-graph.d.ts +194 -0
  38. package/types/lib/document/scene3d.d.ts +76 -0
  39. package/types/lib/document/shader-graph-effects.d.ts +8 -0
  40. package/types/lib/document/shader-graph.d.ts +134 -0
  41. package/types/lib/document/shader-params.d.ts +65 -0
  42. package/types/lib/document/shape-to-path.d.ts +20 -0
  43. package/types/lib/document/text-styles.d.ts +28 -0
  44. package/types/lib/document/text-tokens.d.ts +6 -0
  45. package/types/lib/document/transform.d.ts +79 -0
  46. package/types/lib/document/transform3d.d.ts +99 -0
  47. package/types/lib/document/trim.d.ts +35 -0
  48. package/types/lib/document/types.d.ts +2560 -0
  49. package/types/lib/document/variables.d.ts +14 -0
  50. package/types/lib/editor/easing.d.ts +46 -0
  51. package/types/lib/editor/modes/types.d.ts +131 -0
  52. package/types/lib/editor/prototype-connect.d.ts +49 -0
  53. package/types/lib/editor/smart-animate.d.ts +37 -0
  54. package/types/lib/engine/geometry/flatten.d.ts +2 -0
  55. package/types/lib/engine/geometry/shape-outline.d.ts +24 -0
  56. package/types/lib/engine/pixel/cells.d.ts +12 -0
  57. package/types/lib/engine/pixel/palettes.d.ts +25 -0
  58. package/types/lib/engine/readiness.d.ts +20 -0
  59. package/types/lib/engine/routing.d.ts +41 -0
  60. package/types/lib/engine/shader-graph-presets.d.ts +22 -0
  61. package/types/lib/engine/shader-presets-legacy.d.ts +7 -0
  62. package/types/lib/engine/shader-presets.d.ts +43 -0
  63. package/types/lib/engine/text/atlas.d.ts +120 -0
  64. package/types/lib/engine/text/emoji/segment.d.ts +15 -0
  65. package/types/lib/engine/text/fallback-fonts.d.ts +47 -0
  66. package/types/lib/engine/text/fontkit-lazy.d.ts +8 -0
  67. package/types/lib/engine/text/fonts.d.ts +33 -0
  68. package/types/lib/engine/text/glyph-linear.d.ts +22 -0
  69. package/types/lib/engine/text/google-fonts.d.ts +17 -0
  70. package/types/lib/engine/text/hyphenate/en-us.d.ts +6 -0
  71. package/types/lib/engine/text/hyphenate/liang.d.ts +21 -0
  72. package/types/lib/engine/text/layout-access.d.ts +16 -0
  73. package/types/lib/engine/text/layout.d.ts +168 -0
  74. package/types/lib/engine/text/lists.d.ts +16 -0
  75. package/types/lib/engine/text/measure.d.ts +58 -0
  76. package/types/lib/engine/text/outline-sdf.d.ts +34 -0
  77. package/types/lib/engine/text/shaper.d.ts +88 -0
  78. package/types/lib/engine/text/text-area.d.ts +16 -0
  79. package/types/lib/engine/text/text-fit.d.ts +51 -0
  80. package/types/lib/engine/text/text-path.d.ts +134 -0
  81. package/types/lib/engine/text/text-rings.d.ts +17 -0
  82. package/types/lib/engine/text/wrap-obstacles.d.ts +20 -0
  83. package/types/lib/i18n/catalogs.d.ts +10 -0
  84. package/types/lib/i18n/format.d.ts +27 -0
  85. package/types/lib/i18n/locales.d.ts +25 -0
  86. package/types/lib/i18n/pseudo.d.ts +10 -0
  87. package/types/lib/i18n/runtime.d.ts +27 -0
  88. package/types/lib/io/codecs/wav.d.ts +7 -0
  89. package/types/lib/io/codecs/webp.d.ts +7 -0
  90. package/types/lib/io/export-ir/children.d.ts +2 -0
  91. package/types/lib/io/json-export.d.ts +11 -0
  92. package/types/lib/media-library/types.d.ts +39 -0
  93. package/types/lib/motion/audio-analysis.d.ts +44 -0
  94. package/types/lib/motion/audio-clips.d.ts +92 -0
  95. package/types/lib/motion/audio-onsets.d.ts +13 -0
  96. package/types/lib/motion/audio-signals.d.ts +59 -0
  97. package/types/lib/motion/author.d.ts +80 -0
  98. package/types/lib/motion/composition.d.ts +99 -0
  99. package/types/lib/motion/instances.d.ts +95 -0
  100. package/types/lib/motion/key-selection.d.ts +100 -0
  101. package/types/lib/motion/keys.d.ts +41 -0
  102. package/types/lib/motion/layer-time-edit.d.ts +40 -0
  103. package/types/lib/motion/markers.d.ts +31 -0
  104. package/types/lib/motion/modifier-edit.d.ts +84 -0
  105. package/types/lib/motion/modifiers.d.ts +44 -0
  106. package/types/lib/motion/morph.d.ts +14 -0
  107. package/types/lib/motion/pose-layout.d.ts +6 -0
  108. package/types/lib/motion/pose.d.ts +115 -0
  109. package/types/lib/motion/presets.d.ts +148 -0
  110. package/types/lib/motion/properties.d.ts +74 -0
  111. package/types/lib/motion/sample-keys.d.ts +8 -0
  112. package/types/lib/motion/sample.d.ts +51 -0
  113. package/types/lib/motion/sound.d.ts +25 -0
  114. package/types/lib/motion/spatial-curve.d.ts +15 -0
  115. package/types/lib/motion/spatial.d.ts +38 -0
  116. package/types/lib/motion/text-animators.d.ts +79 -0
  117. package/types/lib/motion/text-units.d.ts +47 -0
  118. package/types/lib/motion/time.d.ts +58 -0
  119. package/types/lib/motion/transitions.d.ts +99 -0
  120. package/types/lib/motion/values.d.ts +12 -0
  121. package/types/lib/motion/video-clip.d.ts +63 -0
  122. package/types/lib/presets/page-presets.d.ts +50 -0
  123. package/types/lib/storage/media-hash.d.ts +4 -0
  124. package/types/lib/storage/media-refs.d.ts +2 -0
  125. package/types/lib/storage/media-store.d.ts +70 -0
  126. package/types/lib/templates/apply.d.ts +38 -0
  127. package/types/lib/templates/capture.d.ts +25 -0
  128. package/types/lib/templates/groups.d.ts +82 -0
  129. package/types/lib/templates/layout.d.ts +20 -0
  130. package/types/lib/templates/quality.d.ts +59 -0
  131. package/types/lib/templates/resize.d.ts +34 -0
  132. package/types/lib/templates/safe-areas.d.ts +42 -0
  133. package/types/lib/templates/text-measurer.d.ts +10 -0
  134. package/types/lib/templates/thumbnail.d.ts +134 -0
  135. package/types/lib/templates/types.d.ts +95 -0
  136. package/types/lib/templates/vocabulary.d.ts +50 -0
  137. package/types/lib/units/units.d.ts +23 -0
  138. package/types/packages/kit/src/index.d.ts +59 -0
  139. package/types/packages/runtime/src/expressions.d.ts +41 -0
  140. package/types/templates/src/app/shared.d.ts +29 -0
  141. package/types/templates/src/audio/beat-loop.d.ts +9 -0
  142. package/types/templates/src/audio/media.d.ts +42 -0
  143. package/types/templates/src/audio/music-synth.d.ts +57 -0
  144. package/types/templates/src/audio/music-worlds.d.ts +8 -0
  145. package/types/templates/src/audio/music.d.ts +19 -0
  146. package/types/templates/src/audio/studio/deck.d.ts +340 -0
  147. package/types/templates/src/audio/studio/dsp.d.ts +151 -0
  148. package/types/templates/src/audio/studio/fx.d.ts +96 -0
  149. package/types/templates/src/audio/studio/mix.d.ts +84 -0
  150. package/types/templates/src/audio/studio/voices.d.ts +120 -0
  151. package/types/templates/src/data/geometry.d.ts +16 -0
  152. package/types/templates/src/effects/shared.d.ts +17 -0
  153. package/types/templates/src/kit.d.ts +582 -0
  154. package/types/templates/src/motion3d/devices.d.ts +42 -0
  155. package/types/templates/src/motion3d/ui.d.ts +48 -0
  156. package/types/templates/src/saas/video-shared.d.ts +114 -0
  157. package/types/templates/src/saas/web-shared.d.ts +74 -0
  158. package/types/templates/src/shared/beat.d.ts +24 -0
  159. package/types/templates/src/shared/captions.d.ts +24 -0
  160. package/types/templates/src/shared/devices.d.ts +188 -0
  161. package/types/templates/src/shared/draw.d.ts +43 -0
  162. package/types/templates/src/shared/fit.d.ts +73 -0
  163. package/types/templates/src/shared/marks.d.ts +51 -0
  164. package/types/templates/src/shared/motion.d.ts +15 -0
  165. package/types/templates/src/shared/overlays.d.ts +80 -0
  166. package/types/templates/src/shared/pointer.d.ts +46 -0
  167. package/types/templates/src/shared/texture.d.ts +41 -0
  168. package/types/templates/src/shared/type.d.ts +6 -0
  169. package/types/templates/src/shared/window.d.ts +50 -0
  170. package/types/templates/src/social/shared.d.ts +66 -0
  171. package/types/templates/src/web/shared.d.ts +64 -0
@@ -0,0 +1,120 @@
1
+ import { type Sig, type Stereo } from './dsp.js';
2
+ import { type GuitarParams } from './deck.js';
3
+ /**
4
+ * Several players on one note: `make` is called for each with its own seed and its own tuning (cents), and they are
5
+ * laid across the stereo field, none quite on time. A section, not a louder soloist.
6
+ */
7
+ export declare function ensemble(players: number, seed: number, make: (seed: number, detune: number, k: number) => Sig, o?: {
8
+ spread?: number;
9
+ pan?: number;
10
+ late?: number;
11
+ detune?: number;
12
+ }): Stereo;
13
+ /** A player's hand: `late()` is a few ms either side of the beat, `vel(v)` a velocity near `v`. Seeded. */
14
+ export declare function human(seed: number, ms?: number, soft?: number): {
15
+ late: () => number;
16
+ vel: (v: number) => number;
17
+ pick: () => number;
18
+ };
19
+ /**
20
+ * A piano note, from its strings' partials. Each partial is tuned sharp of the harmonic by the string's stiffness
21
+ * (more, the higher the note), is as loud as the hammer's hardness and striking point make it, and rings as two
22
+ * strings a hair apart: one that speaks at once and dies soon, one quieter that sings on (the beating between them
23
+ * is the piano's shimmer). Velocity changes the tone, not just the level: a soft hammer is a dark one. `felt` lays a
24
+ * strip of felt between hammer and string: darker, shorter, with the thud and the mechanism heard. Stereo.
25
+ */
26
+ export declare function piano(freq: number, v: number, dur: number, seed: number, o?: {
27
+ felt?: boolean;
28
+ pedal?: boolean;
29
+ }): Stereo;
30
+ export type Rank = 'principal' | 'flute' | 'bourdon' | 'reed' | 'string';
31
+ /**
32
+ * One organ pipe. Its rank's harmonics, held; tuned a little on its own (no two pipes of an organ agree) and
33
+ * breathing with the wind; speaking with a chiff (a breath of noise and a moment of the overtone before the note
34
+ * settles, slower the bigger the pipe) and hissing faintly while it sounds. It stops when the key lifts: the
35
+ * building carries it from there.
36
+ */
37
+ export declare function pipe(freq: number, dur: number, seed: number, rank?: Rank): Sig;
38
+ export type Horn = 'trumpet' | 'trombone' | 'horn' | 'sax' | 'tenor' | 'mute';
39
+ /**
40
+ * A wind player's note. The lips (or the reed) buzz a narrow pulse and a saw; the tone opens with the breath, so a
41
+ * loud note is a bright one and every attack bites then settles; the bore's resonances are fixed, whatever the note;
42
+ * the pitch is scooped into, wavers a hair, and takes its vibrato late; breath is heard in it. `fall` (semitones)
43
+ * drops off the end of the note, `bright` 0…1 is how hard it is blown.
44
+ */
45
+ export declare function wind(kind: Horn, freq: number, v: number, dur: number, seed: number, o?: {
46
+ bright?: number;
47
+ vibrato?: number;
48
+ fall?: number;
49
+ detune?: number;
50
+ }): Sig;
51
+ /**
52
+ * A steel-string acoustic guitar: the deck's plucked string (./deck.ts `guitar`, undriven) picked at a point (which
53
+ * hollows out the harmonics that have a node there), inside its box.
54
+ */
55
+ export declare function acoustic(freq: number, v: number, seed: number, o?: {
56
+ stop?: number;
57
+ bright?: number;
58
+ nail?: number;
59
+ }): Sig;
60
+ /** A plucked double bass: the same string, slack and dark, in a big box, with the finger's thump; `stop` s long. */
61
+ export declare function upright(freq: number, v: number, dur: number, seed: number): Sig;
62
+ /** A string section's pizzicato: the string muted and undriven (./deck.ts `guitar`), in a small box. */
63
+ export declare function pizz(freq: number, v: number, seed: number, len?: number): Sig;
64
+ /** An electric guitar into a fuzz and a cabinet: the deck's string driven as far as it goes, then a 4×12's narrow voice. */
65
+ export declare function fuzzGuitar(freq: number, v: number, seed: number, o?: Pick<GuitarParams, 'stop' | 'mute'> & {
66
+ tone?: number;
67
+ }): Sig;
68
+ export type KickStyle = 'edm' | 'punch' | 'acoustic' | 'jazz' | 'deep' | 'big';
69
+ /** A kick drum, each on a deck drum voice, with a beater's click and a little saturation for weight. */
70
+ export declare function kick(style: KickStyle, v?: number, seed?: number): Sig;
71
+ /** A snare: a deck drum voice for the shell (two of its modes) and the wires, which rattle with the head. */
72
+ export declare function snare(v: number, seed: number, o?: {
73
+ tune?: number;
74
+ wires?: number;
75
+ ring?: number;
76
+ rim?: boolean;
77
+ }): Sig;
78
+ /** A hi-hat (closed, or `open` and ringing): the deck's 808 cymbal, each stroke tuned a hair apart. */
79
+ export declare function hat(v: number, seed: number, open?: boolean, bright?: number): Sig;
80
+ /** A ride cymbal: the stick's ping over a long, quiet wash; `bell` for the cup. */
81
+ export declare function ride(v: number, seed: number, bell?: boolean): Sig;
82
+ /** A crash, one side: the deck cymbal, noisier and long, its top fading before its body. Two seeds make a stereo pair. */
83
+ export declare function crash(v: number, seed: number, seconds?: number): Sig;
84
+ /** A tom, or (low and long) a floor tom. */
85
+ export declare const tom: (freq: number, v: number, seed: number) => Sig;
86
+ /** A timpani stroke at `freq`: the drum voice, long, with the head's other modes over it. */
87
+ export declare function timpani(freq: number, v: number, seed: number): Sig;
88
+ /** A handclap (the deck's): `hands` 3–4 is the drum machine's, 8 and up a room of people. */
89
+ export declare const clap: (v: number, seed: number, hands?: number, tail?: number) => Sig;
90
+ /** A shaker's stroke: the deck's noise burst with a slow rise (the beads take a moment to land). */
91
+ export declare const shaker: (v: number, seed: number) => Sig;
92
+ /**
93
+ * Jingles shaken once: sleigh bells, or a tambourine's zils. Many small collisions, thick at first and thinning as
94
+ * the shake dies, each ringing the metal's own high resonances.
95
+ */
96
+ export declare function jingles(v: number, seed: number, o?: {
97
+ freqs?: readonly number[];
98
+ decay?: number;
99
+ density?: number;
100
+ q?: number;
101
+ }): Sig;
102
+ /** A wire brush stirred over a snare head for `dur` s: a hiss that swells and thins as the hand goes round `turns` times. */
103
+ export declare function brushStir(dur: number, seed: number, turns?: number): Sig;
104
+ /** A brush's tap: the wires land a few at a time, on a head that answers quietly. */
105
+ export declare function brushTap(v: number, seed: number): Sig;
106
+ /**
107
+ * A glockenspiel bar: the deck's bell (./deck.ts `bell`: the fundamental and the bar's first overtone, 2.76× up) with
108
+ * the next two modes of a steel bar over it and the mallet's click.
109
+ */
110
+ export declare function glock(freq: number, v: number, decay?: number): Sig;
111
+ /** A block of wood (or a clock's escapement, higher and drier) struck at `freq`. */
112
+ export declare function wood(freq: number, v?: number, dry?: number): Sig;
113
+ /** A riser: noise swept up through a band, and a pitch climbing an octave or two under it, swelling to the end. */
114
+ export declare function riser(seconds: number, seed: number, octaves?: number): Stereo;
115
+ /** A deep drop: a sine falling from `from` Hz to the floor. Under an impact. */
116
+ export declare function subDrop(from?: number, seconds?: number): Sig;
117
+ /** A record's surface, or a tape's: hiss, and (with `crackle`) the dust. */
118
+ export declare function surface(seconds: number, seed: number, crackle?: number): Stereo;
119
+ /** A door's creak: wood sticking and slipping faster and faster, ringing in the door. */
120
+ export declare function creak(seconds: number, seed: number): Sig;
@@ -0,0 +1,16 @@
1
+ import type { VectorPath } from '../../../lib/document/types.js';
2
+ /**
3
+ * One slice of a donut in a `size` × `size` box: from `from` to `to` (fractions of a turn, clockwise from the top),
4
+ * between `inner` and the outer radius (fractions of the box's half-width). `gap` (px) is left between slices.
5
+ */
6
+ export declare function donutSlice(size: number, from: number, to: number, inner?: number, gap?: number): VectorPath;
7
+ /** A polyline through `points` (open: a line chart's line, drawn as a stroke). */
8
+ export declare const polyline: (points: readonly {
9
+ x: number;
10
+ y: number;
11
+ }[]) => VectorPath;
12
+ /** Where each value of `values` sits in a `width` × `height` plot running from `min` to `max`, evenly across. */
13
+ export declare function plot(values: readonly number[], width: number, height: number, min: number, max: number): {
14
+ x: number;
15
+ y: number;
16
+ }[];
@@ -0,0 +1,17 @@
1
+ import type { Kit, Fill, VariantSpec } from '../kit.js';
2
+ import type { Effect, ShaderParamValue } from '../../../lib/document/types.js';
3
+ export declare const BACKGROUND = "Background";
4
+ /**
5
+ * A full-bleed background on `sheet`: an absolutely placed shape the sheet's size, added before anything else so it
6
+ * paints first. Named `Background` so every size can find it again.
7
+ */
8
+ export declare function background(k: Kit, sheet: string, fill: Fill, o?: {
9
+ effects?: Effect[];
10
+ name?: string;
11
+ }): string;
12
+ /** A full-bleed shader preset behind the sheet's column, named `Shader backdrop`; its paint is `f1`. */
13
+ export declare function shaderBackdrop(k: Kit, sheet: string, shader: string, params: Record<string, ShaderParamValue>, effects?: Effect[]): string;
14
+ /** Every full-bleed layer (`names`) under `sheetId` sized to the sheet again, at its corner: what a resized copy needs. */
15
+ export declare function refill(k: Kit, sheetId: string, names?: readonly string[]): void;
16
+ /** `specs` with each copy's full-bleed layers refilled after its own adjustments. */
17
+ export declare const refilled: (specs: readonly VariantSpec[], names?: readonly string[]) => VariantSpec[];