@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,42 @@
1
+ export interface Inset {
2
+ top: number;
3
+ right: number;
4
+ bottom: number;
5
+ left: number;
6
+ }
7
+ export interface Rect {
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface SafeArea {
14
+ id: string;
15
+ label: string;
16
+ /** The size the insets are given at. */
17
+ width: number;
18
+ height: number;
19
+ /** Keep important content inside these margins. */
20
+ insets: Inset;
21
+ /** Regions inside the safe rect that the platform fills with its own elements (end-screen slots). */
22
+ zones?: (Rect & {
23
+ label: string;
24
+ })[];
25
+ }
26
+ export declare const SAFE_AREAS: readonly SafeArea[];
27
+ export declare const safeArea: (id: string) => SafeArea | undefined;
28
+ /** Which areas a page preset is posted under: a 1080×1920 sheet goes to all four vertical-video apps. */
29
+ export declare const PRESET_SAFE_AREAS: Record<string, readonly string[]>;
30
+ /** `area`'s safe rect at a `width`×`height` sheet (insets scale with the sheet). */
31
+ export declare function safeRect(area: SafeArea, width: number, height: number): Rect;
32
+ /** The rect that is safe under every area a preset is posted to (their intersection), or null when none apply. */
33
+ export declare function presetSafeRect(presetId: string, width: number, height: number): Rect | null;
34
+ /** Whether `inner` lies inside `outer` (within half a pixel). */
35
+ export declare const contains: (outer: Rect, inner: Rect) => boolean;
36
+ /** Whether two rects overlap (touching edges do not count). */
37
+ export declare const overlaps: (a: Rect, b: Rect) => boolean;
38
+ /**
39
+ * Inset (px) that keeps a sheet's content inside `presetId`'s safe rect — what a variant's padding is set to.
40
+ * `symmetric` evens the sides out (the wider of the two), so a centred layout stays centred on the sheet.
41
+ */
42
+ export declare function safePadding(presetId: string, width: number, height: number, atLeast: Inset, symmetric?: boolean): Inset;
@@ -0,0 +1,10 @@
1
+ import type { TextMeasurer } from '../document/instance-layout.js';
2
+ import type { AnyNode, Document } from '../document/types.js';
3
+ export declare const templateTextMeasurer: TextMeasurer;
4
+ /** `n` as the canvas shows it: `{{brand.x}}` tokens in a text, or in the text properties an instance fills its component with, read from the string variables. */
5
+ export declare function shownNode(doc: Pick<Document, 'variables' | 'variableCollections'>, n: AnyNode): AnyNode;
6
+ /**
7
+ * The canvas's measurer, headless, for one document: a text measured at the words it shows (its brand tokens read
8
+ * from `doc`'s variables, as the canvas resolves them before it lays a text out), with the font-metric measurer.
9
+ */
10
+ export declare const shownTextMeasurer: (doc: Pick<Document, "variables" | "variableCollections">) => TextMeasurer;
@@ -0,0 +1,134 @@
1
+ import type { Template } from './types.js';
2
+ /** Device pixels per CSS pixel every picture is drawn for. */
3
+ export declare const THUMBNAIL_DPR = 2;
4
+ /** The largest CSS box a gallery tile shows a template in. */
5
+ export declare const THUMBNAIL_CSS: {
6
+ readonly width: 360;
7
+ readonly height: 360;
8
+ };
9
+ /** The card still's largest size in pixels. */
10
+ export declare const THUMBNAIL_MAX: {
11
+ readonly width: number;
12
+ readonly height: number;
13
+ };
14
+ /** The largest CSS box the detail view shows a template in. */
15
+ export declare const DETAIL_CSS: {
16
+ readonly width: 900;
17
+ readonly height: 700;
18
+ };
19
+ /** The detail still's largest size in pixels. */
20
+ export declare const DETAIL_MAX: {
21
+ readonly width: number;
22
+ readonly height: number;
23
+ };
24
+ /** What the detail still is stored as. */
25
+ export declare const DETAIL_TYPE = "image/webp";
26
+ /** The most a design is scaled up to fill the box: a small design is drawn sharp, not blown up. */
27
+ export declare const THUMBNAIL_MAX_SCALE = 2;
28
+ /** A still as the API accepts it: a WebP, PNG or JPEG data URL (JPEG: templates saved before WebP stills). */
29
+ export declare const THUMBNAIL_DATA_URL: RegExp;
30
+ /** Characters a still's data URL may run to (the official set's largest is about a third of this). */
31
+ export declare const MAX_THUMBNAIL_CHARS = 400000;
32
+ /** The scale that fits a `width` × `height` design in `box` (px), at most `THUMBNAIL_MAX_SCALE`. */
33
+ export declare function thumbnailScale(width: number, height: number, box?: {
34
+ width: number;
35
+ height: number;
36
+ }): number;
37
+ /** Pictured in `thumbnailRegion`'s world coordinates. */
38
+ export interface Region {
39
+ minX: number;
40
+ minY: number;
41
+ maxX: number;
42
+ maxY: number;
43
+ }
44
+ /**
45
+ * What a size's picture shows, in the template's (and so the opened file's) world coordinates: the first sheet
46
+ * that is not a master, at the size's dimensions — a deck's opening slide at its own. The same framing the SVG
47
+ * picture uses (lib/templates/preview-svg.ts), so a card's picture does not jump between the two.
48
+ */
49
+ export declare function thumbnailRegion(t: Template, sizeId: string): Region;
50
+ /** A still's pixel size for a `width` × `height` design, fitted in `box` (the card still's by default). */
51
+ export declare function thumbnailSize(width: number, height: number, box?: {
52
+ width: number;
53
+ height: number;
54
+ }): {
55
+ width: number;
56
+ height: number;
57
+ };
58
+ /**
59
+ * Rendered pixels laid on white, in place: a template is paper, and a design drawn on nothing would come out
60
+ * transparent (and a card's own ground would show through it).
61
+ */
62
+ export declare function flattenOnWhite<T extends Uint8Array | Uint8ClampedArray>(px: T): T;
63
+ /** A rendered still (straight RGBA, flattened on white here) as lossless WebP bytes. */
64
+ export declare function thumbnailWebp(img: {
65
+ width: number;
66
+ height: number;
67
+ data: Uint8Array | Uint8ClampedArray;
68
+ }): Uint8Array;
69
+ /** A rendered still as the data URL a template carries (its card still). */
70
+ export declare function thumbnailDataUrl(img: {
71
+ width: number;
72
+ height: number;
73
+ data: Uint8Array | Uint8ClampedArray;
74
+ }): string;
75
+ /**
76
+ * An animated template's hover loop: an H.264 MP4 (muted, no sound track) through the export's own video writer
77
+ * (lib/io/video). MP4, because it plays in a `<video>` in every browser and WebView the app ships in (Safari and the
78
+ * desktop app included); a GIF of the same loop is several times larger and bands every gradient to 256 colours.
79
+ */
80
+ export declare const PREVIEW_TYPE = "video/mp4";
81
+ /** The loop's largest size in pixels: 2× a gallery card (up to 480 × 360 CSS px). */
82
+ export declare const PREVIEW_MAX: {
83
+ readonly width: 960;
84
+ readonly height: 720;
85
+ };
86
+ /** A loop shows at most this much of a timeline (ms): the opening of a long trailer, all of a sting. */
87
+ export declare const PREVIEW_MAX_MS = 6000;
88
+ /** Frames per second a loop plays at, at most (the timeline's own rate when lower). */
89
+ export declare const PREVIEW_MAX_FPS = 30;
90
+ /** Bits per second the loop is encoded at: flat motion graphics at this size stay clean. */
91
+ export declare const PREVIEW_BITRATE = 900000;
92
+ /** The most bytes a stored loop may have. */
93
+ export declare const MAX_PREVIEW_BYTES: number;
94
+ /** What a stored loop may be (decided from its bytes). */
95
+ export declare const PREVIEW_TYPES: ReadonlySet<string>;
96
+ /** The loop's pixel size for a `width` × `height` design: fitted in `PREVIEW_MAX`, even (4:2:0 video). */
97
+ export declare function previewSize(width: number, height: number): {
98
+ width: number;
99
+ height: number;
100
+ };
101
+ /** The stored pictures beyond the inline card still: `anim` (the loop) and `still` (the detail still). */
102
+ export declare const PREVIEW_FILES: readonly ["anim", "still"];
103
+ export type TemplatePreviewFile = (typeof PREVIEW_FILES)[number];
104
+ export declare const isTemplatePreviewFile: (v: unknown) => v is TemplatePreviewFile;
105
+ /** What each may be (decided from its bytes). */
106
+ export declare const PREVIEW_FILE_TYPES: Record<TemplatePreviewFile, ReadonlySet<string>>;
107
+ /** One stored file as the row records it: the private Blob it is in and what it is. */
108
+ export interface StoredTemplateMedia {
109
+ type: string;
110
+ url: string;
111
+ bytes: number;
112
+ width?: number;
113
+ height?: number;
114
+ durationMs?: number;
115
+ }
116
+ /** The row's `templates.preview`. */
117
+ export type StoredTemplatePreview = Partial<Record<TemplatePreviewFile, StoredTemplateMedia>>;
118
+ /** One file as the API describes it: where the app serves it, never its Blob URL. */
119
+ export interface TemplateMediaRef {
120
+ type: string;
121
+ /** `/api/templates/<id>/preview/<file>?v=…` */
122
+ url: string;
123
+ width?: number;
124
+ height?: number;
125
+ durationMs?: number;
126
+ }
127
+ /** A template's stored pictures on the wire (`meta.preview`). */
128
+ export type TemplatePreviewMedia = Partial<Record<TemplatePreviewFile, TemplateMediaRef>>;
129
+ /** Where the app serves one file (`v` changes when the file does, so a cached one is never stale). */
130
+ export declare const templatePreviewPath: (id: string, file: TemplatePreviewFile, m: Pick<StoredTemplateMedia, "bytes">) => string;
131
+ /** A row's stored pictures as the API describes them. */
132
+ export declare function previewMediaOf(id: string, p: StoredTemplatePreview | null | undefined): TemplatePreviewMedia | undefined;
133
+ /** Where a template's file lives in Blob: beside its payload (`templates/<id>/payload.json`). */
134
+ export declare const previewBlobPath: (id: string, file: TemplatePreviewFile, type: string) => string;
@@ -0,0 +1,95 @@
1
+ import type { AnyNode, DocumentKind, Style, Variable, VariableCollection } from '../document/types.js';
2
+ import type { ModeId } from '../editor/modes/types.js';
3
+ import type { LibraryUse } from '../document/libraries.js';
4
+ import type { TemplateFacets } from './vocabulary.js';
5
+ import type { TemplatePreviewMedia } from './thumbnail.js';
6
+ export type TemplateKind = DocumentKind;
7
+ export type TemplateSource = 'builtin' | 'user' | 'workspace' | 'marketplace';
8
+ /** What a kind implies for the editor, so UI, export and creation agree (see `kinds.ts`). */
9
+ export interface KindProfile {
10
+ pageModel: 'fixed' | 'canvas';
11
+ mode: ModeId;
12
+ defaultExport: 'pdf-print' | 'png' | 'prototype' | 'html-email' | 'none';
13
+ /** What Play does: present on the canvas (the default), or open the page as a live website beside it. */
14
+ play?: 'present' | 'preview';
15
+ }
16
+ /** One size of a template: the roots laid out for that page size (a deck's slides, a set's post). `sizeId` is a page preset id, or 'free'. */
17
+ export interface TemplateVariant {
18
+ sizeId: string;
19
+ rootIds: string[];
20
+ width: number;
21
+ height: number;
22
+ thumbnail?: string;
23
+ }
24
+ /** A place a brand kit can restyle: bound to a document variable the template's nodes reference. */
25
+ export interface BrandSlot {
26
+ id: string;
27
+ kind: 'color' | 'font' | 'logo' | 'text';
28
+ label: string;
29
+ variableId: string;
30
+ }
31
+ /** Facets (animated, duration, fps, platforms, formats, use cases) are described in `vocabulary.ts`. */
32
+ export interface TemplateMeta extends TemplateFacets {
33
+ id: string;
34
+ name: string;
35
+ description?: string;
36
+ kind: TemplateKind;
37
+ category: string;
38
+ tags: string[];
39
+ locale?: string;
40
+ author?: {
41
+ name: string;
42
+ url?: string;
43
+ };
44
+ license?: 'cc0' | 'popcraft' | 'proprietary';
45
+ /** The card's still: a data URL (lib/templates/thumbnail.ts). */
46
+ thumbnail?: string;
47
+ /** An animated template's hover loop, where the app serves it (a cloud row's; lib/templates/thumbnail.ts). */
48
+ preview?: TemplatePreviewMedia;
49
+ /** Google / system family names to load before the template is shown. */
50
+ fonts: string[];
51
+ brandSlots: BrandSlot[];
52
+ source: TemplateSource;
53
+ /** Ids this template was published under before, still honoured when a file or seed names one. */
54
+ aliases?: string[];
55
+ schema: 1;
56
+ createdAt: number;
57
+ updatedAt: number;
58
+ }
59
+ export interface TemplatePayload {
60
+ mode: 'document' | 'fragment';
61
+ /** Ids are local to the template; every use remaps them. Roots have `parentId: null`, positioned from the origin. */
62
+ nodes: Record<string, AnyNode>;
63
+ variants: TemplateVariant[];
64
+ styles?: Record<string, Style>;
65
+ variables?: Record<string, Variable>;
66
+ variableCollections?: Record<string, VariableCollection>;
67
+ /** The file's content collections and their records (lib/document/collections.ts): a blog's posts, an app's sample data. */
68
+ collections?: Record<string, import('../document/types.js').Collection>;
69
+ records?: Record<string, import('../document/types.js').CollectionRecord>;
70
+ libraries?: Record<string, LibraryUse>;
71
+ /** Content hashes (media://) the nodes reference, so a use can fetch what is missing first. */
72
+ media: string[];
73
+ /** Document mode: the canvas pages in order with their roots (every root also belongs to exactly one variant). */
74
+ pages?: {
75
+ id: string;
76
+ name: string;
77
+ rootIds: string[];
78
+ guides?: import('../document/types.js').Guide[];
79
+ }[];
80
+ /** Document-level presentation the sheets were laid out for (a comic issue reads as spreads). */
81
+ facingPages?: boolean;
82
+ /** How the file presents (DocumentSettings `showAdvance` / `showLoop`): a motion piece moves on and loops by itself. */
83
+ show?: {
84
+ advance?: import('../document/types.js').ShowAdvance;
85
+ loop?: boolean;
86
+ };
87
+ /** The node that stands for the file in the browser — a comic's front cover, a deck's title slide. */
88
+ coverNodeId?: string;
89
+ /** Scene sequences over the template's frames (lib/motion/composition.ts), remapped with them on every use. */
90
+ compositions?: Record<string, import('../document/types.js').Composition>;
91
+ }
92
+ export interface Template {
93
+ meta: TemplateMeta;
94
+ payload: TemplatePayload;
95
+ }
@@ -0,0 +1,50 @@
1
+ import type { TimelineFps } from '../document/types.js';
2
+ export declare const TEMPLATE_PLATFORMS: readonly ["instagram", "tiktok", "youtube", "facebook", "linkedin", "x", "pinterest", "threads", "snapchat", "twitch", "web", "email", "print", "slides", "ios", "android", "desktop", "broadcast", "product-hunt", "app-store", "google-play", "chrome-web-store", "github"];
3
+ export type TemplatePlatform = typeof TEMPLATE_PLATFORMS[number];
4
+ export declare const TEMPLATE_FORMATS: readonly ["post", "portrait-post", "story", "reel", "short", "video", "thumbnail", "banner", "cover", "carousel", "lower-third", "intro", "outro", "end-screen", "title-card", "logo-sting", "ad", "slide-deck", "poster", "flyer", "card", "document", "page", "screen", "email", "board", "screenshot", "og-image", "gallery", "demo"];
5
+ export type TemplateFormat = typeof TEMPLATE_FORMATS[number];
6
+ export declare const TEMPLATE_USE_CASES: readonly ["announcement", "launch", "sale", "event", "brand-intro", "countdown", "stats", "quote", "tips", "hiring", "testimonial", "interview", "livestream", "podcast", "education", "report", "pitch", "invitation", "portfolio", "menu", "resume", "planning", "onboarding", "newsletter", "receipt", "comic", "title", "waitlist", "changelog", "comparison", "pricing", "milestone", "case-study", "presale"];
7
+ export type TemplateUseCase = typeof TEMPLATE_USE_CASES[number];
8
+ /**
9
+ * The categories — the types inside a kind — an official template may be, by kind. Derived from the one model
10
+ * (lib/templates/groups.ts `TEMPLATE_GROUPS`), which is where a type is added: this is the same list turned round
11
+ * so the build and the fixtures test can ask "may a PRINT template be a `poster`?".
12
+ * - `animation`: a piece whose point is to play (a reel, a sting, a lower third) — the Motion group, the `motion-`
13
+ * id family. Whether a template moves at all is the derived `animated` facet, not a category: a deck whose
14
+ * slides build stays a presentation, an animated hero stays a web page.
15
+ * - `components`: a file of components to use elsewhere (a UI kit).
16
+ * Anything else an older fixture or link says is one of these by `CATEGORY_ALIASES`.
17
+ */
18
+ export declare const TEMPLATE_CATEGORIES: Readonly<Record<string, readonly string[]>>;
19
+ /** Categories that said the same thing twice, and the one they are now. */
20
+ export declare const CATEGORY_ALIASES: Readonly<Record<string, string>>;
21
+ /** `category` in the one scheme (an alias resolved); undefined stays undefined. */
22
+ export declare const canonicalCategory: <T extends string | undefined>(category: T) => T;
23
+ /**
24
+ * What the gallery knows about a template without opening it. `animated`, `durationMs` and `fps` describe the
25
+ * master's timeline and are derived from it by the template build, never typed in by hand, so a card's "3 s"
26
+ * cannot drift from what Play shows.
27
+ */
28
+ export interface TemplateFacets {
29
+ animated?: boolean;
30
+ /** The master timeline's duration, ms. */
31
+ durationMs?: number;
32
+ fps?: TimelineFps;
33
+ platforms?: TemplatePlatform[];
34
+ formats?: TemplateFormat[];
35
+ useCases?: TemplateUseCase[];
36
+ /** Plays and exports to Lottie with nothing blocked; derived from the content (lib/templates/capabilities.ts), never taken from a client. */
37
+ lottie?: boolean;
38
+ /** Has 3D in it; derived like `lottie`. */
39
+ threeD?: boolean;
40
+ /** Shown first, lowest first: set by an official template's source (templates/src), never by a client. */
41
+ featured?: number;
42
+ /** Always first, above every featured rank (PopCraft's latest launch piece): set only by an official template's source (templates/src). */
43
+ pinned?: boolean;
44
+ }
45
+ export declare const FACET_KEYS: readonly ["animated", "durationMs", "fps", "platforms", "formats", "useCases", "lottie", "threeD", "featured", "pinned"];
46
+ export declare const isTemplateFps: (v: unknown) => v is TimelineFps;
47
+ /** The facets carried by `meta`, and nothing else (what a row stores in its `facets` column). */
48
+ export declare function facetsOf(meta: TemplateFacets): TemplateFacets;
49
+ /** "3 sec", "4.5 sec", "1 min 20 sec": a duration as a gallery card says it — localised (lib/i18n/format.ts). */
50
+ export { formatDuration } from '../i18n/format.js';
@@ -0,0 +1,23 @@
1
+ import type { Unit } from '../document/types.js';
2
+ export declare const UNITS: readonly Unit[];
3
+ /** CSS px per one unit. */
4
+ export declare const PX_PER: Record<Unit, number>;
5
+ /** Decimal places that make sense at the unit's scale. */
6
+ export declare const UNIT_PRECISION: Record<Unit, number>;
7
+ export declare const isUnit: (u: unknown) => u is Unit;
8
+ export declare const toPx: (value: number, unit: Unit) => number;
9
+ export declare const fromPx: (px: number, unit: Unit) => number;
10
+ /** Round a px length for display in `unit` (avoids 25.400000000000002). */
11
+ export declare function roundInUnit(px: number, unit: Unit, precision?: number): number;
12
+ /** "12.7mm", "0.5in", "36pt". `px` never carries a suffix. */
13
+ export declare function formatLength(px: number, unit: Unit, precision?: number): string;
14
+ /**
15
+ * Parse a typed length into px. A suffix wins over `fallbackUnit` so "10mm" works in a px document;
16
+ * a bare number is read in `fallbackUnit`. Returns null for anything that is not a length.
17
+ */
18
+ export declare function parseLength(text: string, fallbackUnit: Unit): number | null;
19
+ /**
20
+ * World px between labelled ruler ticks: the smallest step of `unit` whose label spacing on screen is at
21
+ * least `minCssPx`. Keeps labels readable at every zoom and round in the chosen unit.
22
+ */
23
+ export declare function rulerStepPx(zoom: number, unit: Unit, minCssPx?: number): number;
@@ -0,0 +1,59 @@
1
+ import type { Document } from '../../../lib/document/types.js';
2
+ import { type DesignIssue } from '../../../lib/agent/design-script/check.js';
3
+ export { Kit, hex, preset } from '../../../templates/src/kit.js';
4
+ export type * from '../../../templates/src/kit.js';
5
+ export { ease } from '../../../lib/motion/author.js';
6
+ export * as draw from '../../../templates/src/shared/draw.js';
7
+ export * as marks from '../../../templates/src/shared/marks.js';
8
+ export * as fit from '../../../templates/src/shared/fit.js';
9
+ export * as motion from '../../../templates/src/shared/motion.js';
10
+ export * as captions from '../../../templates/src/shared/captions.js';
11
+ export * as overlays from '../../../templates/src/shared/overlays.js';
12
+ export * as texture from '../../../templates/src/shared/texture.js';
13
+ export * as pointer from '../../../templates/src/shared/pointer.js';
14
+ export * as windows from '../../../templates/src/shared/window.js';
15
+ export * as devices from '../../../templates/src/shared/devices.js';
16
+ export * as type from '../../../templates/src/shared/type.js';
17
+ export * as beat from '../../../templates/src/shared/beat.js';
18
+ export * as web from '../../../templates/src/web/shared.js';
19
+ export * as social from '../../../templates/src/social/shared.js';
20
+ export * as video from '../../../templates/src/saas/video-shared.js';
21
+ export * as site from '../../../templates/src/saas/web-shared.js';
22
+ export * as effects from '../../../templates/src/effects/shared.js';
23
+ export { loadKitModules, HELPER_NAMES } from '../../../lib/agent/design-script/kit-modules.js';
24
+ export { checkDesign, MAX_FRAME_PX, type DesignIssue } from '../../../lib/agent/design-script/check.js';
25
+ export type { Document } from '../../../lib/document/types.js';
26
+ /** Every shipped music track's tempo, as plain numbers (the `TRACKS` a design script sees). */
27
+ export declare function tracks(): Promise<Record<string, {
28
+ bpm: number;
29
+ beatMs: number;
30
+ durationMs: number;
31
+ }>>;
32
+ export interface DesignResult {
33
+ /** The built document; present even when the script failed part-way (it holds what came before the failure). */
34
+ document?: Document;
35
+ /** Where the script failed, with its line when known. */
36
+ error?: {
37
+ message: string;
38
+ line?: number;
39
+ };
40
+ /** The design checks (contrast, small text, safe areas, overlap, seams…) over every frame the script made. */
41
+ issues: DesignIssue[];
42
+ /** How many kit calls the script made. */
43
+ calls: number;
44
+ }
45
+ /**
46
+ * Run a design script — the text `write_design` takes, using `k`, `W`, `H`, `web`, `beat`… — in a sandboxed `vm`
47
+ * context (no network, no file system, a time limit) and check what it built.
48
+ */
49
+ export declare function runDesign(source: string, options?: {
50
+ size?: string | {
51
+ width: number;
52
+ height: number;
53
+ };
54
+ name?: string;
55
+ }): Promise<DesignResult>;
56
+ /** A document as the text of a .popcraft file. */
57
+ export declare const toPopcraft: (document: Document) => string;
58
+ /** Read the text of a .popcraft file; null when it is not one. */
59
+ export declare const fromPopcraft: (text: string) => Document | null;
@@ -0,0 +1,41 @@
1
+ export type ExprValue = number | string | boolean | object;
2
+ /** A record as the adding-up functions read it: its values by field key, and when it was made (ms). */
3
+ export interface ExprRow {
4
+ values: Record<string, unknown>;
5
+ at?: number;
6
+ }
7
+ /** A collection's records by its name (any case); undefined when there is none of that name. */
8
+ export interface ExprData {
9
+ rows(collection: string): readonly ExprRow[] | undefined;
10
+ }
11
+ /** Thrown when an expression asks for something that is not there (a collection, here); the caller decides what that means. */
12
+ export declare class ExprMissing extends Error {
13
+ }
14
+ export declare const num: (v: ExprValue) => number;
15
+ export declare const truthy: (v: ExprValue) => boolean;
16
+ /** A value as words: whole numbers as they are, others to at most 4 places with trailing zeros dropped. */
17
+ export declare const exprText: (v: ExprValue) => string;
18
+ export declare const finite: (n: number) => number;
19
+ /** The local calendar day a moment falls on, as a whole number that goes up by one a day. */
20
+ export declare const dayOf: (ms: number) => number;
21
+ export declare const keyOf: (name: ExprValue) => string;
22
+ /** Every function an expression may call: arguments already worked out, and the records it may add up. */
23
+ export declare const FUNCTIONS: Record<string, (a: ExprValue[], data?: ExprData) => ExprValue>;
24
+ /** `==`: text compares as text, numbers as numbers. */
25
+ export declare const same: (a: ExprValue, b: ExprValue) => boolean;
26
+ /** The operators, as expressions use them: `+` joins text, dividing by zero is 0, `%` is never negative. */
27
+ export declare const ops: {
28
+ add: (a: ExprValue, b: ExprValue) => ExprValue;
29
+ sub: (a: ExprValue, b: ExprValue) => number;
30
+ mul: (a: ExprValue, b: ExprValue) => number;
31
+ div: (a: ExprValue, b: ExprValue) => number;
32
+ mod: (a: ExprValue, b: ExprValue) => number;
33
+ lt: (a: ExprValue, b: ExprValue) => boolean;
34
+ le: (a: ExprValue, b: ExprValue) => boolean;
35
+ gt: (a: ExprValue, b: ExprValue) => boolean;
36
+ ge: (a: ExprValue, b: ExprValue) => boolean;
37
+ eq: (a: ExprValue, b: ExprValue) => boolean;
38
+ ne: (a: ExprValue, b: ExprValue) => boolean;
39
+ neg: (a: ExprValue) => number;
40
+ not: (a: ExprValue) => boolean;
41
+ };
@@ -0,0 +1,29 @@
1
+ import type { Kit, VariantSpec } from '../kit.js';
2
+ export declare const PHONES: {
3
+ readonly iphone: {
4
+ readonly preset: "iphone-17";
5
+ readonly top: 16;
6
+ readonly bottom: 34;
7
+ readonly side: 24;
8
+ };
9
+ readonly android: {
10
+ readonly preset: "android-large";
11
+ readonly top: 12;
12
+ readonly bottom: 24;
13
+ readonly side: 24;
14
+ };
15
+ };
16
+ /** A screen: an auto-layout column on the page ground, inside the phone's insets. */
17
+ export declare function screen(k: Kit, id: string, o?: {
18
+ gap?: number;
19
+ justify?: 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN';
20
+ align?: 'MIN' | 'CENTER' | 'MAX';
21
+ paper?: string;
22
+ }): void;
23
+ /** The status bar: the time on the left, signal and battery on the right, in `ink`. */
24
+ export declare function statusBar(k: Kit, parent: string, o: {
25
+ ink?: string;
26
+ style: string;
27
+ }): string;
28
+ /** The Android copy of an iPhone screen: the same design at 412 × 915, inside Android's insets. */
29
+ export declare function androidVariant(name: string, tweak?: (k: Kit, id: string) => void): VariantSpec;
@@ -0,0 +1,9 @@
1
+ export declare const BEAT_LOOP_RATE = 48000;
2
+ export declare const BEAT_LOOP_BPM = 120;
3
+ /** Beats in the loop (two bars of 4/4). */
4
+ export declare const BEAT_LOOP_BEATS = 8;
5
+ export declare const BEAT_MS: number;
6
+ export declare const BEAT_LOOP_MS: number;
7
+ export declare const BEAT_LOOP_LICENSE = "CC0-1.0 \u2014 made in code by PopCraft (templates/src/audio/beat-loop.ts)";
8
+ /** The loop's samples, mono, peak-normalised to 0.8. */
9
+ export declare function renderBeatLoop(): Float32Array;
@@ -0,0 +1,42 @@
1
+ /** "Pop Drop", the 120 BPM two-bar loop (templates/src/audio/beat-loop.ts), as a 16-bit 48 kHz mono WAV. */
2
+ export declare const BEAT_LOOP_HASH = "cf2451754681fba543bf8555b67096a7";
3
+ /**
4
+ * The music videos' tracks (templates/src/audio/music.ts: 16-bit 32 kHz mono WAVs) and the worlds' (music-worlds.ts:
5
+ * 16-bit 32 kHz stereo), made in code by PopCraft (CC0), by track. `scripts/gen-template-audio.mts` prints these.
6
+ */
7
+ export declare const MUSIC_HASH: {
8
+ readonly lofi: "c159b9d831836fac8eb7851f97b7d512";
9
+ readonly edm: "ea527ac5a58bd4bc256e3c59a8951d75";
10
+ readonly synthwave: "ecc97f0a47cfec61591854a2286365dd";
11
+ readonly hiphop: "6ad90265c64cf6331e9a994726c1b063";
12
+ readonly indie: "7a187ae354f49178a71983c05042a858";
13
+ readonly podcast: "53c62231561821a97cadf89aab0ea928";
14
+ readonly house: "49be9bf094487fb7850a48a426cc2c45";
15
+ readonly organ: "26b155ed2f4c45dc985e2eab791dea10";
16
+ readonly chiptune: "c72efbc265758886c7f6174d0bb2fe2e";
17
+ readonly noirJazz: "ecb7c6debdc8c5bc7ef20be0b3ccb59f";
18
+ readonly bigBand: "54a8bf87fc7e00224890f00e255eaf48";
19
+ readonly trailer: "478263b5f61d1b450cf63abc7b6324dc";
20
+ readonly launch: "6be50baa067882777c108cce828d0b75";
21
+ readonly festive: "3e30d7756b67ac1ee7d18c2e7d4940f7";
22
+ readonly spooky: "3a19d9f72c9dd06e9508e6d7c6d232da";
23
+ readonly psychRock: "9af1baf76ccf1d23fa8c7273fbd5df33";
24
+ readonly acoustic: "81942dba13134621905388963d65cd9e";
25
+ readonly tension: "c0951f814e70ac59e3517788a02ef68c";
26
+ readonly calm: "32031c89c78fefefeb62d6260f6f20ef";
27
+ };
28
+ /** Where a shipped media file lives. */
29
+ export declare const shippedMediaPath: (hash: string) => any;
30
+ /** A shipped WAV's samples, after checking the file is the one its hash names. */
31
+ export declare function shippedWav(hash: string): {
32
+ channels: Float32Array[];
33
+ sampleRate: number;
34
+ };
35
+ /** The slideshow songs (templates/src/audio/slideshow-music.ts), each a 16-bit 22.05 kHz mono WAV. */
36
+ export declare const SONG_HASHES: {
37
+ readonly vows: "f17f04e573e88b9f63936e11ee4e93ac";
38
+ readonly keepsake: "0df08287bdfd65fefbcd398e2e82ddfd";
39
+ readonly littleSteps: "a06946f32124317b13052db257f7b26f";
40
+ readonly openRoad: "d72905a3318231444ace15d355069ee7";
41
+ readonly bright: "f342f49c3b2544f8842ed00ee2193539";
42
+ };
@@ -0,0 +1,57 @@
1
+ /** The rate the tracks are rendered and shipped at (Hz): mono, 16-bit. */
2
+ export declare const MUSIC_RATE = 32000;
3
+ export declare const TAU: number;
4
+ export declare const R = 32000;
5
+ export declare const midi: (m: number) => number;
6
+ /** A deterministic noise source (LCG), −1…1. */
7
+ export declare function noiseGen(seed: number): () => number;
8
+ /** PolyBLEP correction at phase `t` (0…1) for a step of `dt`. */
9
+ export declare function blep(t: number, dt: number): number;
10
+ /** A band-limited sawtooth, `n` samples at `freq` (a function of the sample index when it glides). */
11
+ export declare function saw(n: number, freq: number | ((i: number) => number), phase0?: number): Float64Array;
12
+ /** A band-limited square (pulse width `pw`). */
13
+ export declare function square(n: number, freq: number, pw?: number): Float64Array;
14
+ /** A state-variable lowpass (the trapezoidal, always-stable form) over `x`, its cutoff (Hz) a function of the sample index, resonance `q`. */
15
+ export declare function lowpass(x: Float64Array, cutoff: number | ((i: number) => number), q?: number): Float64Array;
16
+ /** A one-pole highpass. */
17
+ export declare function highpass(x: Float64Array, cutoff: number): Float64Array;
18
+ /** A biquad bandpass (constant peak gain) at `freq` with bandwidth `q`. */
19
+ export declare function bandpass(x: Float64Array, freq: number, q: number): Float64Array;
20
+ /** A small Schroeder reverb (four combs, two allpasses): the wet signal only. */
21
+ export declare function reverb(x: Float64Array, size?: number, damp?: number): Float64Array;
22
+ /** A plucked string (Karplus–Strong), `n` samples at `freq`, brightness 0…1. */
23
+ export declare function pluck(n: number, freq: number, seed: number, bright?: number): Float64Array;
24
+ /** An attack–decay envelope, `n` samples: rises over `a` s, then falls with time constant `d` s. */
25
+ export declare function env(n: number, a: number, d: number): Float64Array;
26
+ /** An ADSR, `len` s long with release `r` s after it. */
27
+ export declare function adsr(n: number, a: number, d: number, s: number, len: number, r: number): Float64Array;
28
+ export declare const mul: (a: Float64Array, b: Float64Array | number) => Float64Array;
29
+ /** A mix bus `seconds` long. */
30
+ export declare class Bus {
31
+ readonly out: Float64Array;
32
+ constructor(seconds: number);
33
+ /** `x` added from `at` s, times `gain`. */
34
+ add(at: number, x: Float64Array, gain?: number): void;
35
+ /** Another bus mixed in. */
36
+ mix(b: Bus, gain?: number): void;
37
+ }
38
+ export declare function kick(punch?: number, decay?: number, top?: number, bottom?: number): Float64Array;
39
+ export declare function snare(seed: number, tone?: number, decay?: number, crack?: number): Float64Array;
40
+ export declare function clap(seed: number): Float64Array;
41
+ export declare function hat(seed: number, open?: boolean, bright?: number): Float64Array;
42
+ /** An electric piano note: a sine with a bell overtone and a soft tine attack. */
43
+ export declare function epiano(freq: number, len: number, trem?: number): Float64Array;
44
+ /** An acoustic-ish piano note: a few decaying partials, slightly stretched. */
45
+ export declare function piano(freq: number, len: number): Float64Array;
46
+ /** A detuned saw stack (`voices` saws spread by `detune` cents), lowpassed at `cutoff`. */
47
+ export declare function supersaw(freq: number, len: number, cutoff: number | ((i: number) => number), voices?: number, detune?: number, release?: number): Float64Array;
48
+ /** A 808-style sub: a sine gliding from the last note, with a little drive. */
49
+ export declare function sub808(freq: number, len: number, from?: number): Float64Array;
50
+ /** Vinyl: a soft hiss and seeded crackles. */
51
+ export declare function vinyl(seconds: number, seed: number, amount?: number): Float64Array;
52
+ /** A white-noise riser: swept up through a bandpass, swelling over `seconds`. */
53
+ export declare function riser(seconds: number, seed: number): Float64Array;
54
+ /** The mix soft-clipped, peak-normalised to 0.89, with a 10 ms fade at the end so a loop never clicks. */
55
+ export declare function master(x: Float64Array, drive?: number): Float32Array;
56
+ /** Sidechain pumping: a gain curve ducking after every beat. */
57
+ export declare function pump(n: number, beatS: number, depth?: number, recover?: number): Float64Array;
@@ -0,0 +1,8 @@
1
+ export type WorldTrackId = 'organ' | 'chiptune' | 'noirJazz' | 'bigBand' | 'trailer' | 'launch' | 'festive' | 'spooky' | 'psychRock' | 'acoustic' | 'tension' | 'calm';
2
+ /** The worlds' tracks: what each is called, its tempo, its bars, and its render (left and right). */
3
+ export declare const WORLD_TRACKS: Record<WorldTrackId, {
4
+ title: string;
5
+ bpm: number;
6
+ bars: number;
7
+ render: () => Float32Array[];
8
+ }>;
@@ -0,0 +1,19 @@
1
+ export { MUSIC_RATE } from './music-synth.js';
2
+ import { type WorldTrackId } from './music-worlds.js';
3
+ export declare const MUSIC_LICENSE = "CC0-1.0 \u2014 made in code by PopCraft (templates/src/audio/music.ts)";
4
+ export type TrackId = 'lofi' | 'edm' | 'synthwave' | 'hiphop' | 'indie' | 'podcast' | 'house' | WorldTrackId;
5
+ export interface TrackInfo {
6
+ id: TrackId;
7
+ title: string;
8
+ bpm: number;
9
+ bars: number;
10
+ /** ms of the file. */
11
+ durationMs: number;
12
+ /** ms a beat lasts. */
13
+ beatMs: number;
14
+ }
15
+ export declare const TRACK_IDS: TrackId[];
16
+ /** What a track is: its title, tempo and length. */
17
+ export declare function trackInfo(id: TrackId): TrackInfo;
18
+ /** A track's samples at `MUSIC_RATE`, a Float32Array a channel: one for the music videos' tracks (mono), two for the worlds' (stereo). */
19
+ export declare function renderTrack(id: TrackId): Float32Array[];