From f4dabb4012b88860cd277d8cba7333adcda55fd1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 02:25:20 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=EC=8B=9C=EC=9E=91=20=E2=80=94=2091?= =?UTF-8?q?=EB=B0=94=ED=80=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019Ted7kvLRcnQBfHBm7xX9i From bb3c701b25507444eec2b466bff6262a6991aa08 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 02:29:40 +0000 Subject: [PATCH 2/2] web: drop Pattern Lab exports no other file reads knip found 64 exports in lib/lab and app/pattern-lab that no file imports. SHADER_PREAMBLE_LINES and TimelineZoom had no reader at all and go; the other 62 lose the export keyword. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019Ted7kvLRcnQBfHBm7xX9i --- .../panels/director/useShowEditing.ts | 4 ++-- .../panels/director/useTimelineZoom.ts | 2 -- .../panels/pixel/usePixelSelection.ts | 2 +- .../pattern-lab/panels/pixel/usePixelViewport.ts | 2 +- web/src/app/pattern-lab/panels/registry.tsx | 6 +++--- web/src/lib/lab/annotations.ts | 2 -- web/src/lib/lab/capture/client.ts | 2 +- web/src/lib/lab/capture/probe.ts | 16 ++++++++-------- web/src/lib/lab/capture/session.ts | 2 +- web/src/lib/lab/capture/settings.ts | 4 ++-- web/src/lib/lab/capture/shaderSource.ts | 7 ++----- web/src/lib/lab/capture/shaderStage.ts | 2 +- web/src/lib/lab/cppPrompt.ts | 2 +- web/src/lib/lab/director/bake.ts | 6 +++--- web/src/lib/lab/director/sample.ts | 2 +- web/src/lib/lab/director/types.ts | 2 +- web/src/lib/lab/editorReveal.ts | 4 ++-- web/src/lib/lab/engine.ts | 2 +- web/src/lib/lab/flatten.ts | 2 +- web/src/lib/lab/hExport.ts | 6 +++--- web/src/lib/lab/legacyDraft.ts | 6 +++--- web/src/lib/lab/pixelTools.ts | 2 +- web/src/lib/lab/serialize.ts | 2 +- web/src/lib/lab/sessions.ts | 2 +- web/src/lib/lab/store/director.ts | 2 +- web/src/lib/lab/store/knobs.ts | 2 +- web/src/lib/lab/store/layers.ts | 2 +- web/src/lib/lab/store/project.ts | 2 +- web/src/lib/lab/store/ramp.ts | 2 +- web/src/lib/lab/store/text.ts | 2 +- web/src/lib/lab/text.ts | 4 ++-- web/src/lib/lab/textEffects.ts | 8 ++++---- web/src/lib/lab/textFonts.ts | 10 +++++----- web/src/lib/lab/textRaster.ts | 2 +- web/src/lib/lab/types.ts | 2 +- 35 files changed, 60 insertions(+), 67 deletions(-) diff --git a/web/src/app/pattern-lab/panels/director/useShowEditing.ts b/web/src/app/pattern-lab/panels/director/useShowEditing.ts index 050a7d685..4e4822609 100644 --- a/web/src/app/pattern-lab/panels/director/useShowEditing.ts +++ b/web/src/app/pattern-lab/panels/director/useShowEditing.ts @@ -17,7 +17,7 @@ import { useLabStore } from "@/lib/lab/store"; import { wireToY, yToWire } from "../directorGeometry"; import { CURVE_MAGNET_PX, FOCUS_PAD } from "./constants"; -export type Selection = +type Selection = | { kind: "key"; lane: number; id: string } | { kind: "msg"; id: string } | null; @@ -29,7 +29,7 @@ export function interpOf(k: DirectorKeyframe): Interp { return k.h === "auto" ? "auto" : "manual"; } -export function sortedLane(lane: DirectorKeyframe[]): DirectorKeyframe[] { +function sortedLane(lane: DirectorKeyframe[]): DirectorKeyframe[] { return [...lane].sort((a, b) => a.t - b.t); } diff --git a/web/src/app/pattern-lab/panels/director/useTimelineZoom.ts b/web/src/app/pattern-lab/panels/director/useTimelineZoom.ts index b3041865d..696fa64df 100644 --- a/web/src/app/pattern-lab/panels/director/useTimelineZoom.ts +++ b/web/src/app/pattern-lab/panels/director/useTimelineZoom.ts @@ -75,5 +75,3 @@ export function useTimelineZoom({ return { pps, focusH, zoomBy }; } - -export type TimelineZoom = ReturnType; diff --git a/web/src/app/pattern-lab/panels/pixel/usePixelSelection.ts b/web/src/app/pattern-lab/panels/pixel/usePixelSelection.ts index 5fb226d75..b1e85256d 100644 --- a/web/src/app/pattern-lab/panels/pixel/usePixelSelection.ts +++ b/web/src/app/pattern-lab/panels/pixel/usePixelSelection.ts @@ -8,7 +8,7 @@ import { cutRegion, scaleNearest, stampRegionOver, type PixelSurface } from "@/l import { normRect, type Cell, type Floating, type SelRect } from "./tools"; /** The drag in progress: drawing the box, or moving the lifted cut. */ -export type SelectAction = { +type SelectAction = { mode: "select" | "move"; startX: number; startY: number; diff --git a/web/src/app/pattern-lab/panels/pixel/usePixelViewport.ts b/web/src/app/pattern-lab/panels/pixel/usePixelViewport.ts index e3ae44f21..1b0290b46 100644 --- a/web/src/app/pattern-lab/panels/pixel/usePixelViewport.ts +++ b/web/src/app/pattern-lab/panels/pixel/usePixelViewport.ts @@ -10,7 +10,7 @@ import type { Cell } from "./tools"; import { WHEEL_NOTCH_PX, wheelPixels } from "./wheel"; export const ZOOM_MIN = 1; -export const ZOOM_MAX = 32; +const ZOOM_MAX = 32; /** * The largest whole zoom that shows the picture entire inside a viewport of diff --git a/web/src/app/pattern-lab/panels/registry.tsx b/web/src/app/pattern-lab/panels/registry.tsx index bcbce97b7..e328f6079 100644 --- a/web/src/app/pattern-lab/panels/registry.tsx +++ b/web/src/app/pattern-lab/panels/registry.tsx @@ -41,9 +41,9 @@ export type PanelId = | "capture" | "director"; -export type DockDirection = "right" | "below" | "within"; +type DockDirection = "right" | "below" | "within"; -export type PanelDef = { +type PanelDef = { id: PanelId; /** The tab title. Belongs here, not to a saved layout — a rename reaches everyone. */ title: string; @@ -92,7 +92,7 @@ export function panelDef(id: string): PanelDef | undefined { return PANELS.find((entry) => entry.id === id); } -export type PanelPress = "opened" | "fronted" | "closed"; +type PanelPress = "opened" | "fronted" | "closed"; /** * A press on a panel's name in the Panels menu. A closed panel opens, a panel diff --git a/web/src/lib/lab/annotations.ts b/web/src/lib/lab/annotations.ts index d4bebd64e..6f47f6cfd 100644 --- a/web/src/lib/lab/annotations.ts +++ b/web/src/lib/lab/annotations.ts @@ -19,12 +19,10 @@ import { import type { KnobRange } from "./types"; export { - DEFAULT_KNOB_LABELS, KNOBS_ANNOTATION_RE, buildKnobsAnnotationLine, matchKnobsAnnotation, parseKnobsAnnotation, - stripKnobsAnnotation, }; export type { KnobAnnotationEntry }; diff --git a/web/src/lib/lab/capture/client.ts b/web/src/lib/lab/capture/client.ts index e495e3493..b776171f4 100644 --- a/web/src/lib/lab/capture/client.ts +++ b/web/src/lib/lab/capture/client.ts @@ -28,7 +28,7 @@ export type ProjectSlice = { ranges: Array<[number, number]>; }; -export type CaptureClientHandlers = { +type CaptureClientHandlers = { onFrame: (frame: FrameMessage) => void; onState: (state: { time: number; playing: boolean }) => void; onProgress: (done: number, total: number) => void; diff --git a/web/src/lib/lab/capture/probe.ts b/web/src/lib/lab/capture/probe.ts index 867511c52..9ebaebc67 100644 --- a/web/src/lib/lab/capture/probe.ts +++ b/web/src/lib/lab/capture/probe.ts @@ -69,27 +69,27 @@ export const PROBE_LAYOUT_MAX = 27; * fault of the code — in both cases the upscale is pixel-identical to the * native render and costs a fraction of it, so the verdict is the same. */ -export const PROBE_DETAIL_MIN = 0.02; -export const PROBE_DENSITY_MIN = 0.55; -export const PROBE_DENSITY_MAX = 1.5; -export const PROBE_LUMINANCE_MIN = 10; +const PROBE_DETAIL_MIN = 0.02; +const PROBE_DENSITY_MIN = 0.55; +const PROBE_DENSITY_MAX = 1.5; +const PROBE_LUMINANCE_MIN = 10; /** Below this mean neighbour difference a frame is flat — no texture to compare. */ -export const PROBE_VARIATION_MIN = 2; -export const PROBE_NOISE_MAX = 12; +const PROBE_VARIATION_MIN = 2; +const PROBE_NOISE_MAX = 12; const PROBE_PIXEL_BUDGET = 600_000; const PROBE_STEPS = 8; const PROBE_DT = 0.4; const PROBE_SAMPLES = [3, 5, 8]; /** Aspect-true multiple of the matrix the probe renders at, within budget. */ -export function probeGrid(matrix: MatrixSize): MatrixSize { +function probeGrid(matrix: MatrixSize): MatrixSize { const pixels = matrix.width * matrix.height; const factor = Math.max(2, Math.min(4, Math.floor(Math.sqrt(PROBE_PIXEL_BUDGET / pixels)))); return { width: matrix.width * factor, height: matrix.height * factor }; } /** Box-filter an RGBA buffer to a coarser RGB float grid. */ -export function boxDown( +function boxDown( data: Uint8ClampedArray, width: number, height: number, diff --git a/web/src/lib/lab/capture/session.ts b/web/src/lib/lab/capture/session.ts index 35b9b24ae..b6c5486bf 100644 --- a/web/src/lib/lab/capture/session.ts +++ b/web/src/lib/lab/capture/session.ts @@ -38,7 +38,7 @@ export type CaptureSessionState = { output: { width: number; height: number } | null; }; -export type CaptureSessionEvents = { +type CaptureSessionEvents = { /** Per-layer errors from the latest frame, named for people. */ errors?: (errors: Record) => void; auto?: (auto: AutoVerdict | null) => void; diff --git a/web/src/lib/lab/capture/settings.ts b/web/src/lib/lab/capture/settings.ts index 725ea1b3b..76056d8e0 100644 --- a/web/src/lib/lab/capture/settings.ts +++ b/web/src/lib/lab/capture/settings.ts @@ -14,9 +14,9 @@ import { type CaptureSettings, } from "./types"; -export const CAPTURE_SETTINGS_STORAGE = LAB_STORAGE.capture; +const CAPTURE_SETTINGS_STORAGE = LAB_STORAGE.capture; -export type SizePreset = { id: string; label: string; width: number; height: number }; +type SizePreset = { id: string; label: string; width: number; height: number }; /** * Sizes worth a one-click pick. The matrix multiples keep the pattern's own diff --git a/web/src/lib/lab/capture/shaderSource.ts b/web/src/lib/lab/capture/shaderSource.ts index ee2e561fa..09ddc497b 100644 --- a/web/src/lib/lab/capture/shaderSource.ts +++ b/web/src/lib/lab/capture/shaderSource.ts @@ -67,13 +67,10 @@ vec4 ramp(float v) { #line 1 `; -/** How many lines the preamble adds before the user's line 1. */ -export const SHADER_PREAMBLE_LINES = SHADER_PREAMBLE.split("\n").length - 1; - export type ShaderPass = "image" | "state"; /** The name of the entry point a pass calls. */ -export const SHADER_ENTRY: Record = { +const SHADER_ENTRY: Record = { image: "mainImage", state: "mainState", }; @@ -130,7 +127,7 @@ export function remapShaderLog(log: string): string { .join("\n"); } -export type ShaderSourceCheck = { ok: true; hasState: boolean } | { ok: false; error: string }; +type ShaderSourceCheck = { ok: true; hasState: boolean } | { ok: false; error: string }; /** What can be said about a source without a GPU. */ export function checkShaderSource(source: string): ShaderSourceCheck { diff --git a/web/src/lib/lab/capture/shaderStage.ts b/web/src/lib/lab/capture/shaderStage.ts index 29d3d3ba3..b328fe3ae 100644 --- a/web/src/lib/lab/capture/shaderStage.ts +++ b/web/src/lib/lab/capture/shaderStage.ts @@ -28,7 +28,7 @@ import { type ShaderPass, } from "./shaderSource"; -export type ShaderFrame = { +type ShaderFrame = { geometry: CaptureGeometry; /** The picture at `geometry.render`, for the painter to place. */ canvas: OffscreenCanvas; diff --git a/web/src/lib/lab/cppPrompt.ts b/web/src/lib/lab/cppPrompt.ts index db5c98fb4..ad4eac962 100644 --- a/web/src/lib/lab/cppPrompt.ts +++ b/web/src/lib/lab/cppPrompt.ts @@ -18,7 +18,7 @@ function roundRangeValue(value: number) { return Math.round(value * 1000) / 1000; } -export type CppPromptArgs = { +type CppPromptArgs = { code: string; matrix: MatrixSize; knobs: number[]; diff --git a/web/src/lib/lab/director/bake.ts b/web/src/lib/lab/director/bake.ts index 20c658311..03920bb51 100644 --- a/web/src/lib/lab/director/bake.ts +++ b/web/src/lib/lab/director/bake.ts @@ -117,7 +117,7 @@ export function resolveLane(lane: DirectorKeyframe[]): DirectorKeyframe[] { } /** One lane's cue values by second: keyframes plus curve samples, dupes elided. */ -export function bakeLane(lane: DirectorKeyframe[]): Map { +function bakeLane(lane: DirectorKeyframe[]): Map { const keys = resolveLane(lane); const raw = new Map(); for (let i = 0; i < keys.length; i++) { @@ -145,7 +145,7 @@ export function bakeLane(lane: DirectorKeyframe[]): Map { return out; } -export type BakedShow = { +type BakedShow = { perf: Performance; cueCount: number; /** Approximate string-pool bytes (messages; the real check is encodePfst). */ @@ -400,7 +400,7 @@ export function bakeLaneV2(lane: DirectorKeyframe[]): V2Point[] { return [...seen.values()].sort((a, b) => a.t - b.t); } -export type BakedShowV2 = { +type BakedShowV2 = { perf: Performance; cueCount: number; overBudget: boolean; diff --git a/web/src/lib/lab/director/sample.ts b/web/src/lib/lab/director/sample.ts index 594755f24..eef172daf 100644 --- a/web/src/lib/lab/director/sample.ts +++ b/web/src/lib/lab/director/sample.ts @@ -11,7 +11,7 @@ import { BUS_WIRE_MAX } from "@/lib/pattern/controls"; import { bakeShowV2, resolveLane, resolvedLaneValue } from "./bake"; import type { DirectorShow } from "./types"; -export type SampledShow = { +type SampledShow = { /** Samples per second. */ fps: number; /** Number of samples per lane; sample i sits at t = i / fps. */ diff --git a/web/src/lib/lab/director/types.ts b/web/src/lib/lab/director/types.ts index d30696bb8..1a617d687 100644 --- a/web/src/lib/lab/director/types.ts +++ b/web/src/lib/lab/director/types.ts @@ -101,7 +101,7 @@ export function snapWireTime(t: number): number { } export const DIRECTOR_MAX_SECONDS = 3600; -export const DIRECTOR_DEFAULT_SECONDS = 30; +const DIRECTOR_DEFAULT_SECONDS = 30; export function directorId(): string { return `d${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`; diff --git a/web/src/lib/lab/editorReveal.ts b/web/src/lib/lab/editorReveal.ts index e47f93eed..b54996518 100644 --- a/web/src/lib/lab/editorReveal.ts +++ b/web/src/lib/lab/editorReveal.ts @@ -10,9 +10,9 @@ // re-clicking the already-active layer — the exact "let me in" gesture — would // change nothing and emit nothing. -export type EditorKind = "code" | "pixel" | "text"; +type EditorKind = "code" | "pixel" | "text"; -export type EditorRevealRequest = { +type EditorRevealRequest = { kind: EditorKind; /** Creating a layer may reopen a closed editor panel; selecting never does. */ open: boolean; diff --git a/web/src/lib/lab/engine.ts b/web/src/lib/lab/engine.ts index 9bde506a1..5f0586637 100644 --- a/web/src/lib/lab/engine.ts +++ b/web/src/lib/lab/engine.ts @@ -77,7 +77,7 @@ export type EngineProject = { ranges: Array<[number, number]>; }; -export type EngineFrame = { +type EngineFrame = { data: Uint8ClampedArray; width: number; height: number; diff --git a/web/src/lib/lab/flatten.ts b/web/src/lib/lab/flatten.ts index 8cdad484a..4c8b2632c 100644 --- a/web/src/lib/lab/flatten.ts +++ b/web/src/lib/lab/flatten.ts @@ -70,7 +70,7 @@ function pixelBufferLiteral(data: Uint8ClampedArray, length = "__W * __H * 4"): } import { isRasterLayer, type CodeLayer, type KnobRange, type Layer, type RampLayer, type TextLayer } from "./types"; -export type FlattenKnobs = { labels: string[]; ranges: KnobRange[] }; +type FlattenKnobs = { labels: string[]; ranges: KnobRange[] }; function stripForEmbedding(code: string): string { return ( diff --git a/web/src/lib/lab/hExport.ts b/web/src/lib/lab/hExport.ts index 4100824b3..80eaf929d 100644 --- a/web/src/lib/lab/hExport.ts +++ b/web/src/lib/lab/hExport.ts @@ -131,11 +131,11 @@ const blendCode = (blend: Layer["blend"]) => blend === "add" ? 1 : blend === "multiply" ? 2 : blend === "screen" ? 3 : 0; export const SLOT_BEGIN = (i: number) => `// >>> LAYER ${i} TRANSLATION BEGIN <<<`; -export const SLOT_END = (i: number) => `// >>> LAYER ${i} TRANSLATION END <<<`; +const SLOT_END = (i: number) => `// >>> LAYER ${i} TRANSLATION END <<<`; // ── export bundle ── -export type HExportLayerUnit = { +type HExportLayerUnit = { /** Stack index (bottom → top) — also the L namespace number. */ index: number; name: string; @@ -155,7 +155,7 @@ export type HExportArgs = { knobLabels: string[]; }; -export type HExport = { +type HExport = { scaffold: string; units: HExportLayerUnit[]; namespaceName: string; diff --git a/web/src/lib/lab/legacyDraft.ts b/web/src/lib/lab/legacyDraft.ts index 3a5f48657..fa9509a6c 100644 --- a/web/src/lib/lab/legacyDraft.ts +++ b/web/src/lib/lab/legacyDraft.ts @@ -18,17 +18,17 @@ import { isValidMatrix, type MatrixSize } from "@/lib/pattern/matrix"; import { LAB_STORAGE, readJson, removeStorage as remove } from "./persist"; -export const DRAFT_STORAGE = LAB_STORAGE.legacyDraft; +const DRAFT_STORAGE = LAB_STORAGE.legacyDraft; // Guard rail so one runaway value can't blow the whole quota. const MAX_CODE_CHARS = 200_000; /** The July draft also kept the gallery's count, thinking and refs; only this outlived it. */ -export type DraftGenSettings = { +type DraftGenSettings = { colorMode: ColorMode; }; -export type LabDraft = { +type LabDraft = { savedAt: number; code: string; knobs: number[]; diff --git a/web/src/lib/lab/pixelTools.ts b/web/src/lib/lab/pixelTools.ts index 51d8a71d9..cd65d5a7a 100644 --- a/web/src/lib/lab/pixelTools.ts +++ b/web/src/lib/lab/pixelTools.ts @@ -219,7 +219,7 @@ export function clearSurface(surface: PixelSurface) { export type ImportFit = "contain" | "cover" | "stretch" | "center"; /** User placement on top of the base fit: a scale factor and a pixel offset. */ -export type ImportTransform = { scale: number; offsetX: number; offsetY: number }; +type ImportTransform = { scale: number; offsetX: number; offsetY: number }; /** * Rasterize an image into a layer-sized RGBA buffer. `smooth: false` keeps diff --git a/web/src/lib/lab/serialize.ts b/web/src/lib/lab/serialize.ts index 41e965a84..532384ccd 100644 --- a/web/src/lib/lab/serialize.ts +++ b/web/src/lib/lab/serialize.ts @@ -149,7 +149,7 @@ export function bytesToBase64(bytes: Uint8ClampedArray): string { return btoa(binary); } -export function base64ToBytes(base64: string, expectedLength: number): Uint8ClampedArray | null { +function base64ToBytes(base64: string, expectedLength: number): Uint8ClampedArray | null { try { const binary = atob(base64); if (binary.length !== expectedLength) return null; diff --git a/web/src/lib/lab/sessions.ts b/web/src/lib/lab/sessions.ts index e4acc6223..61e8537ab 100644 --- a/web/src/lib/lab/sessions.ts +++ b/web/src/lib/lab/sessions.ts @@ -22,7 +22,7 @@ import { LAB_STORAGE, readJson, writeJson } from "./persist"; const KEY = LAB_STORAGE.sessions; -export const MAX_SESSIONS = 3; +const MAX_SESSIONS = 3; export type SessionMeta = { id: string; diff --git a/web/src/lib/lab/store/director.ts b/web/src/lib/lab/store/director.ts index 5f7b24a26..2c8bda9f8 100644 --- a/web/src/lib/lab/store/director.ts +++ b/web/src/lib/lab/store/director.ts @@ -5,7 +5,7 @@ import type { LabStore } from "../store"; import type { SliceSet } from "./kinds"; -export type DirectorSlice = Pick; +type DirectorSlice = Pick; export function createDirectorSlice(set: SliceSet): DirectorSlice { return { diff --git a/web/src/lib/lab/store/knobs.ts b/web/src/lib/lab/store/knobs.ts index 2cd773685..ddfa83870 100644 --- a/web/src/lib/lab/store/knobs.ts +++ b/web/src/lib/lab/store/knobs.ts @@ -7,7 +7,7 @@ import type { LabStore } from "../store"; import type { SliceSet } from "./kinds"; import { MIN_RANGE_SPAN } from "./shared"; -export type KnobsSlice = Pick; +type KnobsSlice = Pick; export function createKnobsSlice(set: SliceSet): KnobsSlice { return { diff --git a/web/src/lib/lab/store/layers.ts b/web/src/lib/lab/store/layers.ts index 194147c15..505ce4bcd 100644 --- a/web/src/lib/lab/store/layers.ts +++ b/web/src/lib/lab/store/layers.ts @@ -10,7 +10,7 @@ import type { LabStore } from "../store"; import type { SliceSet, SliceGet } from "./kinds"; import { codeLayerFromSource, resizePixelLayers, updateLayer, updateCodeLayer, STARTER_CODE } from "./shared"; -export type LayersSlice = Pick; +type LayersSlice = Pick; export function createLayersSlice(set: SliceSet, get: SliceGet): LayersSlice { return { diff --git a/web/src/lib/lab/store/project.ts b/web/src/lib/lab/store/project.ts index c3e429c65..3607c5704 100644 --- a/web/src/lib/lab/store/project.ts +++ b/web/src/lib/lab/store/project.ts @@ -11,7 +11,7 @@ import type { LabStore } from "../store"; import type { SliceSet, SliceGet } from "./kinds"; import { defaultProject, resizePixelLayers } from "./shared"; -export type ProjectSlice = Pick; +type ProjectSlice = Pick; export function createProjectSlice(set: SliceSet, get: SliceGet): ProjectSlice { return { diff --git a/web/src/lib/lab/store/ramp.ts b/web/src/lib/lab/store/ramp.ts index e171ff6c9..a3e84cecc 100644 --- a/web/src/lib/lab/store/ramp.ts +++ b/web/src/lib/lab/store/ramp.ts @@ -7,7 +7,7 @@ import type { LabStore } from "../store"; import type { SliceSet } from "./kinds"; import { updateCodeLayer, updateRampLayer } from "./shared"; -export type RampSlice = Pick; +type RampSlice = Pick; export function createRampSlice(set: SliceSet): RampSlice { return { diff --git a/web/src/lib/lab/store/text.ts b/web/src/lib/lab/store/text.ts index 4bd067f46..717a491bd 100644 --- a/web/src/lib/lab/store/text.ts +++ b/web/src/lib/lab/store/text.ts @@ -8,7 +8,7 @@ import { createTextLayer, nextLayerName, normalizeTextSpec } from "../types"; import type { LabStore } from "../store"; import type { SliceSet, SliceGet } from "./kinds"; -export type TextSlice = Pick; +type TextSlice = Pick; export function createTextSlice(set: SliceSet, get: SliceGet): TextSlice { return { diff --git a/web/src/lib/lab/text.ts b/web/src/lib/lab/text.ts index 35cde4bf6..83afd8411 100644 --- a/web/src/lib/lab/text.ts +++ b/web/src/lib/lab/text.ts @@ -20,7 +20,7 @@ import { ensureFontReady, resolveFont } from "./textFonts"; import { textCoverage, textReach } from "./textRaster"; import type { RampState, TextLayer, TextSource, TextSpec } from "./types"; -export type InkBounds = { minX: number; minY: number; maxX: number; maxY: number }; +type InkBounds = { minX: number; minY: number; maxX: number; maxY: number }; /** The box around every lit pixel, or null when nothing is lit. */ export function inkBounds(alpha: Uint8ClampedArray, width: number, height: number): InkBounds | null { @@ -168,7 +168,7 @@ function cropToLetters( * The scroll or ramp source for a spec, or null when no letter lands in it. * Undefined where there is no canvas to draw on. */ -export function drawTextSource( +function drawTextSource( spec: TextSpec, ramp: RampState, fontCss: string, diff --git a/web/src/lib/lab/textEffects.ts b/web/src/lib/lab/textEffects.ts index eef2049ba..223882da8 100644 --- a/web/src/lib/lab/textEffects.ts +++ b/web/src/lib/lab/textEffects.ts @@ -27,7 +27,7 @@ export const TEXT_EFFECT_RATE: Record = { }; /** A source is at most this many bytes: as much as the biggest frame (512 × 512) holds. */ -export const TEXT_SOURCE_MAX_BYTES = 512 * 512 * 4; +const TEXT_SOURCE_MAX_BYTES = 512 * 512 * 4; /** * How many columns a source may have on a frame this tall: never fewer than @@ -37,11 +37,11 @@ export function sourceColumnLimit(width: number, height: number): number { return Math.max(width, Math.floor(TEXT_SOURCE_MAX_BYTES / (height * 4))); } -export const TWINKLE_PERIOD = 256; -export const RAMP_PERIOD = 512; +const TWINKLE_PERIOD = 256; +const RAMP_PERIOD = 512; /** A source the layer's frame can be read from: every row, at least one column. */ -export function sourceFits(source: TextSource | null, height: number): source is TextSource { +function sourceFits(source: TextSource | null, height: number): source is TextSource { return ( source !== null && Number.isInteger(source.x) && diff --git a/web/src/lib/lab/textFonts.ts b/web/src/lib/lab/textFonts.ts index eeadf474d..292a8b7fc 100644 --- a/web/src/lib/lab/textFonts.ts +++ b/web/src/lib/lab/textFonts.ts @@ -33,10 +33,10 @@ const SYSTEM_FONTS = [ ] as const; /** What an unknown or missing font draws with. */ -export const FALLBACK_FONT_CSS = "sans-serif"; +const FALLBACK_FONT_CSS = "sans-serif"; /** A 20 MB Korean font is ordinary; past this the tab is better off without it. */ -export const MAX_FONT_FILE_BYTES = 32 * 1024 * 1024; +const MAX_FONT_FILE_BYTES = 32 * 1024 * 1024; export const FONT_FILE_ACCEPT = ".ttf,.otf,.woff,.woff2,font/ttf,font/otf,font/woff,font/woff2"; @@ -63,12 +63,12 @@ export function isFileFont(id: string): boolean { } /** The name a file font goes by in the picker: its file name without the extension. */ -export function fontLabelFromFileName(fileName: string): string { +function fontLabelFromFileName(fileName: string): string { const base = fileName.replace(/\.(ttf|otf|woff2?)$/i, "").trim(); return (base || "Font").slice(0, 60); } -export function fileFontId(label: string): string { +function fileFontId(label: string): string { return `file:${label}`; } @@ -104,7 +104,7 @@ function siteFamily(variable: string, name: string): string { return quoteFamily(name); } -export type ResolvedFont = { +type ResolvedFont = { /** A CSS font-family list for the canvas. */ css: string; /** True for a file font this browser does not have loaded: it draws with the fallback. */ diff --git a/web/src/lib/lab/textRaster.ts b/web/src/lib/lab/textRaster.ts index 31d5e3ddc..be5b23c47 100644 --- a/web/src/lib/lab/textRaster.ts +++ b/web/src/lib/lab/textRaster.ts @@ -9,7 +9,7 @@ import type { TextSpec } from "./types"; let scratch: HTMLCanvasElement | null = null; /** Lines, top to bottom. An empty text draws nothing. */ -export function textLines(text: string): string[] { +function textLines(text: string): string[] { return text.replace(/\r\n?/g, "\n").split("\n"); } diff --git a/web/src/lib/lab/types.ts b/web/src/lib/lab/types.ts index ffcf6093e..a8b1e85a1 100644 --- a/web/src/lib/lab/types.ts +++ b/web/src/lib/lab/types.ts @@ -105,7 +105,7 @@ export const TEXT_ALIGNS: TextAlign[] = ["left", "center", "right"]; /** solid: one colour. rampX / rampY: the layer's ramp runs across / down the letters. */ export type TextFill = "solid" | "rampX" | "rampY"; -export const TEXT_FILLS: TextFill[] = ["solid", "rampX", "rampY"]; +const TEXT_FILLS: TextFill[] = ["solid", "rampX", "rampY"]; /** * What moves the letters, frame by frame, at a speed one knob sets