restty 0.1.23 → 0.1.25
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.
- package/dist/{chunk-mkkhfg0z.js → chunk-pab3ge3d.js} +11446 -7806
- package/dist/fonts/index.d.ts +4 -1
- package/dist/fonts/manager/classification.d.ts +13 -0
- package/dist/fonts/manager/entries.d.ts +13 -0
- package/dist/fonts/manager/picker.d.ts +6 -0
- package/dist/fonts/manager/sources.d.ts +16 -0
- package/dist/fonts/types.d.ts +20 -10
- package/dist/grid/grid.d.ts +5 -3
- package/dist/ime/ime.d.ts +13 -0
- package/dist/index.d.ts +3 -3
- package/dist/input/index.d.ts +1 -1
- package/dist/input/keymap/before-input.d.ts +4 -0
- package/dist/input/keymap/constants.d.ts +13 -0
- package/dist/input/keymap/control.d.ts +2 -0
- package/dist/input/keymap/default-mapping.d.ts +1 -0
- package/dist/input/keymap/kitty.d.ts +1 -0
- package/dist/input/keymap/normalization.d.ts +4 -0
- package/dist/input/keymap/pty-map.d.ts +4 -0
- package/dist/input/keymap.d.ts +2 -11
- package/dist/input/output/csi.d.ts +33 -0
- package/dist/input/{output.d.ts → output/index.d.ts} +6 -9
- package/dist/input/output/osc.d.ts +15 -0
- package/dist/input/output/prompt.d.ts +11 -0
- package/dist/input/types.d.ts +13 -0
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +13 -150
- package/dist/renderer/index.d.ts +7 -2
- package/dist/renderer/shaders/glyph-gl.d.ts +4 -0
- package/dist/renderer/{shaders.d.ts → shaders/glyph-wgsl.d.ts} +0 -10
- package/dist/renderer/shaders/rect.d.ts +6 -0
- package/dist/renderer/shapes/block-elements.d.ts +3 -0
- package/dist/renderer/shapes/box-drawing/dashed-lines.d.ts +3 -0
- package/dist/renderer/shapes/box-drawing/diagonal.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/draw-box-drawing.d.ts +6 -0
- package/dist/renderer/shapes/box-drawing/fallback.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/mapped.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/rounded-corner.d.ts +2 -0
- package/dist/renderer/shapes/braille.d.ts +3 -0
- package/dist/renderer/shapes/classify.d.ts +18 -0
- package/dist/renderer/shapes/geometry.d.ts +9 -0
- package/dist/renderer/shapes/glyph-box.d.ts +7 -0
- package/dist/renderer/shapes/powerline.d.ts +3 -0
- package/dist/renderer/shapes/types.d.ts +38 -0
- package/dist/renderer/shapes.d.ts +8 -81
- package/dist/renderer/webgpu/buffers.d.ts +7 -0
- package/dist/renderer/webgpu/setup.d.ts +10 -0
- package/dist/renderer/webgpu/state.d.ts +15 -0
- package/dist/renderer/webgpu/webgl.d.ts +3 -0
- package/dist/restty.js +1 -1
- package/dist/{app → runtime}/atlas-builder.d.ts +53 -18
- package/dist/runtime/codepoint-utils.d.ts +12 -0
- package/dist/runtime/create-app-io-utils.d.ts +9 -0
- package/dist/runtime/create-app-symbols.d.ts +11 -0
- package/dist/runtime/create-app-types.d.ts +72 -0
- package/dist/runtime/create-runtime/atlas-debug-utils.d.ts +5 -0
- package/dist/runtime/create-runtime/blend-utils.d.ts +11 -0
- package/dist/runtime/create-runtime/color-glyph-atlas.d.ts +11 -0
- package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +1 -0
- package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/types.d.ts +63 -0
- package/dist/runtime/create-runtime/debug-tools.d.ts +6 -0
- package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +39 -0
- package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +20 -0
- package/dist/runtime/create-runtime/font-runtime-helpers.types.d.ts +108 -0
- package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +21 -0
- package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +26 -0
- package/dist/runtime/create-runtime/format-utils.d.ts +2 -0
- package/dist/runtime/create-runtime/input-hooks.d.ts +12 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +12 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +28 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +41 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +28 -0
- package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +18 -0
- package/dist/runtime/create-runtime/interaction-runtime/kitty-overlay-runtime.d.ts +15 -0
- package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +30 -0
- package/dist/runtime/create-runtime/interaction-runtime/types.d.ts +110 -0
- package/dist/runtime/create-runtime/interaction-runtime.d.ts +3 -0
- package/dist/runtime/create-runtime/kitty-overlay-utils.d.ts +26 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size-canvas.d.ts +13 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +6 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size.d.ts +16 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size.types.d.ts +85 -0
- package/dist/runtime/create-runtime/pty-input-runtime.d.ts +45 -0
- package/dist/runtime/create-runtime/render-tick-webgl-context.d.ts +4 -0
- package/dist/runtime/create-runtime/render-tick-webgl-glyph-pipeline.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl.d.ts +3 -0
- package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +162 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +25 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-draw-pass.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-emit-glyphs.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-overlays-atlas.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu.d.ts +3 -0
- package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +386 -0
- package/dist/runtime/create-runtime/render-ticks.d.ts +9 -0
- package/dist/runtime/create-runtime/runtime-app-api.d.ts +103 -0
- package/dist/runtime/create-runtime/runtime-logger.d.ts +17 -0
- package/dist/runtime/create-runtime/runtime-reporting.d.ts +40 -0
- package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +29 -0
- package/dist/runtime/create-runtime.d.ts +7 -0
- package/dist/runtime/font-atlas-utils/bitmap-utils.d.ts +5 -0
- package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +29 -0
- package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +25 -0
- package/dist/runtime/font-atlas-utils/packing-utils.d.ts +13 -0
- package/dist/runtime/overlay-scrollbar.d.ts +24 -0
- package/dist/runtime/pty-output-buffer.d.ts +12 -0
- package/dist/runtime/render-color-utils.d.ts +6 -0
- package/dist/runtime/render-stage-runtime.d.ts +18 -0
- package/dist/runtime/render-stage-shaders.d.ts +6 -0
- package/dist/runtime/shader-stages.d.ts +9 -0
- package/dist/runtime/text-decoration.d.ts +4 -0
- package/dist/{app → runtime}/types.d.ts +39 -1
- package/dist/selection/clipboard.d.ts +4 -0
- package/dist/selection/{selection.d.ts → core.d.ts} +0 -11
- package/dist/selection/index.d.ts +3 -1
- package/dist/selection/text.d.ts +8 -0
- package/dist/surface/app-factory.d.ts +3 -0
- package/dist/{app → surface}/pane-app-manager.d.ts +2 -2
- package/dist/surface/panes/default-context-menu-items.d.ts +8 -0
- package/dist/surface/panes/layout.d.ts +9 -0
- package/dist/surface/panes/manager.d.ts +2 -0
- package/dist/surface/panes/pane-interactions.d.ts +11 -0
- package/dist/surface/panes/window-events.d.ts +10 -0
- package/dist/{app → surface}/panes-types.d.ts +1 -1
- package/dist/surface/restty/active-pane-api.d.ts +23 -0
- package/dist/surface/restty/manager-options.d.ts +24 -0
- package/dist/surface/restty/pane-ops.d.ts +42 -0
- package/dist/surface/restty/plugin-dispatcher.d.ts +39 -0
- package/dist/surface/restty/plugin-ops.d.ts +24 -0
- package/dist/surface/restty/shader-ops.d.ts +27 -0
- package/dist/surface/restty-pane-handle.d.ts +70 -0
- package/dist/surface/restty-plugin-runtime.d.ts +57 -0
- package/dist/surface/restty-plugin-types.d.ts +164 -0
- package/dist/surface/restty-plugin-utils.d.ts +22 -0
- package/dist/surface/restty.d.ts +93 -0
- package/dist/utils/base64.d.ts +12 -0
- package/dist/wasm/index.d.ts +2 -1
- package/dist/wasm/runtime/abi.d.ts +7 -0
- package/dist/wasm/runtime/kitty.d.ts +2 -0
- package/dist/wasm/runtime/render-state.d.ts +2 -0
- package/dist/wasm/runtime/restty-wasm.d.ts +42 -0
- package/dist/wasm/{runtime.d.ts → runtime/types.d.ts} +48 -41
- package/dist/wasm/runtime/view-cache.d.ts +4 -0
- package/dist/xterm/app-options.d.ts +2 -0
- package/dist/xterm/dimensions.d.ts +1 -0
- package/dist/xterm/listeners.d.ts +5 -0
- package/dist/xterm.d.ts +1 -6
- package/dist/xterm.js +61 -63
- package/package.json +1 -1
- package/dist/app/index.d.ts +0 -9
- package/dist/app/panes.d.ts +0 -15
- package/dist/app/restty.d.ts +0 -336
- package/dist/fonts/manager.d.ts +0 -45
- package/dist/renderer/webgpu.d.ts +0 -33
- package/dist/restty-input.d.ts +0 -1
- /package/dist/{app → runtime}/clipboard-paste.d.ts +0 -0
- /package/dist/{app → runtime}/font-sources.d.ts +0 -0
- /package/dist/{app → runtime}/session.d.ts +0 -0
- /package/dist/{app → surface}/panes-context-menu.d.ts +0 -0
- /package/dist/{app → surface}/panes-styles.d.ts +0 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import type { FontEntry, FontManagerState } from "../../fonts";
|
|
2
|
+
import type { NerdConstraint } from "../../fonts/nerd-constraints";
|
|
3
|
+
import type { Color, WebGPUState } from "../../renderer";
|
|
4
|
+
import type { CompiledWebGPUShaderStage, WebGPUStageTargets } from "../create-app-types";
|
|
5
|
+
import type { GlyphConstraintMeta } from "../atlas-builder";
|
|
6
|
+
import type { KittyPlacement, RenderState, ResttyWasm, ResttyWasmExports } from "../../wasm";
|
|
7
|
+
export type CursorPosition = {
|
|
8
|
+
col: number;
|
|
9
|
+
row: number;
|
|
10
|
+
wideTail: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type GlyphShape = {
|
|
13
|
+
glyphId: number;
|
|
14
|
+
xAdvance: number;
|
|
15
|
+
xOffset: number;
|
|
16
|
+
yOffset: number;
|
|
17
|
+
};
|
|
18
|
+
export type ShapedCluster = {
|
|
19
|
+
glyphs: GlyphShape[];
|
|
20
|
+
advance: number;
|
|
21
|
+
};
|
|
22
|
+
export type NerdMetrics = {
|
|
23
|
+
cellWidth: number;
|
|
24
|
+
cellHeight: number;
|
|
25
|
+
faceWidth: number;
|
|
26
|
+
faceHeight: number;
|
|
27
|
+
faceY: number;
|
|
28
|
+
iconHeight: number;
|
|
29
|
+
iconHeightSingle: number;
|
|
30
|
+
};
|
|
31
|
+
export type GlyphQueueItem = {
|
|
32
|
+
x: number;
|
|
33
|
+
baseY: number;
|
|
34
|
+
xPad: number;
|
|
35
|
+
fg: Color;
|
|
36
|
+
bg: Color;
|
|
37
|
+
shaped: ShapedCluster;
|
|
38
|
+
fontIndex: number;
|
|
39
|
+
scale: number;
|
|
40
|
+
cellWidth: number;
|
|
41
|
+
symbolLike: boolean;
|
|
42
|
+
symbolConstraint?: boolean;
|
|
43
|
+
constraintWidth?: number;
|
|
44
|
+
forceFit?: boolean;
|
|
45
|
+
glyphWidthPx?: number;
|
|
46
|
+
cp?: number;
|
|
47
|
+
italic?: boolean;
|
|
48
|
+
bold?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type WebGPUFrame = {
|
|
51
|
+
bgData: number[];
|
|
52
|
+
selectionData: number[];
|
|
53
|
+
underlineData: number[];
|
|
54
|
+
cursorData: number[];
|
|
55
|
+
fgRectData: number[];
|
|
56
|
+
overlayData: number[];
|
|
57
|
+
glyphDataNearestByFont: Map<number, number[]>;
|
|
58
|
+
glyphDataLinearByFont: Map<number, number[]>;
|
|
59
|
+
glyphQueueByFont: Map<number, GlyphQueueItem[]>;
|
|
60
|
+
overlayGlyphDataNearestByFont: Map<number, number[]>;
|
|
61
|
+
overlayGlyphDataLinearByFont: Map<number, number[]>;
|
|
62
|
+
overlayGlyphQueueByFont: Map<number, GlyphQueueItem[]>;
|
|
63
|
+
neededGlyphIdsByFont: Map<number, Set<number>>;
|
|
64
|
+
neededGlyphMetaByFont: Map<number, Map<number, GlyphConstraintMeta>>;
|
|
65
|
+
scaleByFont: number[];
|
|
66
|
+
bitmapScaleByFont: number[];
|
|
67
|
+
baselineAdjustByFont: number[];
|
|
68
|
+
nerdMetrics: NerdMetrics;
|
|
69
|
+
getGlyphQueue: (fontIndex: number) => GlyphQueueItem[];
|
|
70
|
+
getOverlayGlyphQueue: (fontIndex: number) => GlyphQueueItem[];
|
|
71
|
+
getGlyphSet: (fontIndex: number) => Set<number>;
|
|
72
|
+
};
|
|
73
|
+
export type WebGPURenderInput = {
|
|
74
|
+
rows: number;
|
|
75
|
+
cols: number;
|
|
76
|
+
codepoints: Uint32Array;
|
|
77
|
+
contentTags: Uint8Array | null;
|
|
78
|
+
wide: Uint8Array | null;
|
|
79
|
+
styleFlags: Uint16Array | null;
|
|
80
|
+
linkIds: Uint32Array | null;
|
|
81
|
+
fgBytes: Uint8Array;
|
|
82
|
+
bgBytes: Uint8Array | null;
|
|
83
|
+
ulBytes: Uint8Array | null;
|
|
84
|
+
ulStyle: Uint8Array | null;
|
|
85
|
+
graphemeOffset: Uint32Array | null;
|
|
86
|
+
graphemeLen: Uint32Array | null;
|
|
87
|
+
graphemeBuffer: Uint32Array | null;
|
|
88
|
+
};
|
|
89
|
+
export type SharedTickDeps = {
|
|
90
|
+
fontState: FontManagerState;
|
|
91
|
+
fontHeightUnits: (font: FontEntry["font"]) => number;
|
|
92
|
+
fontScaleOverride: (entry: FontEntry, overrides: Array<{
|
|
93
|
+
match: RegExp;
|
|
94
|
+
scale: number;
|
|
95
|
+
}>) => number;
|
|
96
|
+
FONT_SCALE_OVERRIDES: Array<{
|
|
97
|
+
match: RegExp;
|
|
98
|
+
scale: number;
|
|
99
|
+
}>;
|
|
100
|
+
isSymbolFont: (entry: FontEntry) => boolean;
|
|
101
|
+
isColorEmojiFont: (entry: FontEntry) => boolean;
|
|
102
|
+
fontAdvanceUnits: (entry: FontEntry, shapeClusterWithFont: (entry: FontEntry, text: string) => ShapedCluster) => number;
|
|
103
|
+
shapeClusterWithFont: (entry: FontEntry, text: string) => ShapedCluster;
|
|
104
|
+
fontMaxCellSpan: (entry: FontEntry) => number;
|
|
105
|
+
clamp: (value: number, min: number, max: number) => number;
|
|
106
|
+
buildNerdMetrics: (cellW: number, cellH: number, lineHeight: number, primaryFont: FontEntry["font"] | undefined, primaryScale: number, iconScale: number) => NerdMetrics;
|
|
107
|
+
nerdIconScale: number;
|
|
108
|
+
selectionState: {
|
|
109
|
+
active: boolean;
|
|
110
|
+
dragging: boolean;
|
|
111
|
+
};
|
|
112
|
+
selectionForRow: (row: number, cols: number) => {
|
|
113
|
+
start: number;
|
|
114
|
+
end: number;
|
|
115
|
+
} | null;
|
|
116
|
+
pushRect: (target: number[], x: number, y: number, width: number, height: number, color: Color) => void;
|
|
117
|
+
pushRectBox: (target: number[], x: number, y: number, width: number, height: number, color: Color) => void;
|
|
118
|
+
selectionColor: Color;
|
|
119
|
+
STYLE_BOLD: number;
|
|
120
|
+
STYLE_ITALIC: number;
|
|
121
|
+
STYLE_FAINT: number;
|
|
122
|
+
STYLE_BLINK: number;
|
|
123
|
+
STYLE_INVERSE: number;
|
|
124
|
+
STYLE_INVISIBLE: number;
|
|
125
|
+
STYLE_STRIKE: number;
|
|
126
|
+
STYLE_OVERLINE: number;
|
|
127
|
+
STYLE_UNDERLINE_MASK: number;
|
|
128
|
+
decodeRGBAWithCache: (bytes: Uint8Array | null, index: number, cache: Map<number, Color>) => Color;
|
|
129
|
+
brighten: (color: Color, amount: number) => Color;
|
|
130
|
+
BOLD_BRIGHTEN: number;
|
|
131
|
+
fade: (color: Color, alpha: number) => Color;
|
|
132
|
+
FAINT_ALPHA: number;
|
|
133
|
+
linkState: {
|
|
134
|
+
hoverId: number;
|
|
135
|
+
};
|
|
136
|
+
drawUnderlineStyle: (target: number[], style: number, x: number, rowY: number, cellW: number, cellH: number, baseY: number, underlineOffsetPx: number, underlineThicknessPx: number, color: Color) => void;
|
|
137
|
+
drawStrikethrough: (target: number[], x: number, rowY: number, cellW: number, cellH: number, color: Color) => void;
|
|
138
|
+
drawOverline: (target: number[], x: number, rowY: number, cellW: number, color: Color) => void;
|
|
139
|
+
KITTY_PLACEHOLDER_CP: number;
|
|
140
|
+
isSpaceCp: (cp: number) => boolean;
|
|
141
|
+
shouldMergeTrailingClusterCodepoint: (cp: number) => boolean;
|
|
142
|
+
isBlockElement: (cp: number) => boolean;
|
|
143
|
+
drawBlockElement: (cp: number, x: number, y: number, cellW: number, cellH: number, fg: Color, target: number[]) => boolean;
|
|
144
|
+
isBoxDrawing: (cp: number) => boolean;
|
|
145
|
+
drawBoxDrawing: (cp: number, x: number, y: number, cellW: number, cellH: number, fg: Color, target: number[], underlineThicknessPx: number) => boolean;
|
|
146
|
+
isBraille: (cp: number) => boolean;
|
|
147
|
+
drawBraille: (cp: number, x: number, y: number, cellW: number, cellH: number, fg: Color, target: number[]) => boolean;
|
|
148
|
+
isPowerline: (cp: number) => boolean;
|
|
149
|
+
drawPowerline: (cp: number, x: number, y: number, cellW: number, cellH: number, fg: Color, target: number[]) => boolean;
|
|
150
|
+
pickFontIndexForText: (text: string, expectedSpan?: number, stylePreference?: string) => number;
|
|
151
|
+
stylePreferenceFromFlags: (bold: boolean, italic: boolean) => string;
|
|
152
|
+
noteColorGlyphText: (entry: FontEntry, text: string, shaped: {
|
|
153
|
+
glyphs: Array<{
|
|
154
|
+
glyphId: number;
|
|
155
|
+
}>;
|
|
156
|
+
}) => void;
|
|
157
|
+
isRenderSymbolLike: (cp: number) => boolean;
|
|
158
|
+
resolveSymbolConstraint: (cp: number) => NerdConstraint | null;
|
|
159
|
+
isGraphicsElement: (cp: number) => boolean;
|
|
160
|
+
glyphWidthUnits: (entry: FontEntry, glyphId: number) => number;
|
|
161
|
+
fitTextTailToWidth: (text: string, maxWidth: number, measure: (value: string) => number) => {
|
|
162
|
+
text: string;
|
|
163
|
+
widthPx: number;
|
|
164
|
+
offset: number;
|
|
165
|
+
};
|
|
166
|
+
PREEDIT_BG: Color;
|
|
167
|
+
PREEDIT_UL: Color;
|
|
168
|
+
PREEDIT_ACTIVE_BG: Color;
|
|
169
|
+
PREEDIT_CARET: Color;
|
|
170
|
+
PREEDIT_FG: Color;
|
|
171
|
+
resizeState: {
|
|
172
|
+
lastAt: number;
|
|
173
|
+
cols: number;
|
|
174
|
+
rows: number;
|
|
175
|
+
};
|
|
176
|
+
RESIZE_OVERLAY_HOLD_MS: number;
|
|
177
|
+
RESIZE_OVERLAY_FADE_MS: number;
|
|
178
|
+
ensureAtlasForFont: (device: GPUDevice, state: WebGPUState, entry: FontEntry, neededGlyphIds: Set<number>, fontSizePx: number, fontIndex: number, atlasScale: number, glyphMeta?: Map<number, GlyphConstraintMeta>, constraintContext?: {
|
|
179
|
+
cellW: number;
|
|
180
|
+
cellH: number;
|
|
181
|
+
yPad: number;
|
|
182
|
+
baselineOffset: number;
|
|
183
|
+
baselineAdjust: number;
|
|
184
|
+
fontScale: number;
|
|
185
|
+
nerdMetrics: NerdMetrics;
|
|
186
|
+
fontEntry: FontEntry;
|
|
187
|
+
} | null) => boolean;
|
|
188
|
+
defaultBg: Color;
|
|
189
|
+
decodePackedRGBA: (packed: number) => Color;
|
|
190
|
+
cursorFallback: Color;
|
|
191
|
+
scrollbarState: {
|
|
192
|
+
lastTotal: number;
|
|
193
|
+
lastOffset: number;
|
|
194
|
+
lastLen: number;
|
|
195
|
+
};
|
|
196
|
+
appendOverlayScrollbar: (target: number[], total: number, offset: number, len: number) => void;
|
|
197
|
+
webgpuUniforms: Float32Array;
|
|
198
|
+
ensureInstanceBuffer: (state: WebGPUState, kind: "rect" | "glyph", minBytes: number) => void;
|
|
199
|
+
GLYPH_INSTANCE_FLOATS: number;
|
|
200
|
+
wasm: ResttyWasm | null;
|
|
201
|
+
drawKittyOverlay: (placements: KittyPlacement[], cellW: number, cellH: number) => void;
|
|
202
|
+
isAppleSymbolsFont: (entry: FontEntry) => boolean;
|
|
203
|
+
DEFAULT_APPLE_SYMBOLS_CONSTRAINT: NerdConstraint;
|
|
204
|
+
DEFAULT_SYMBOL_CONSTRAINT: NerdConstraint;
|
|
205
|
+
DEFAULT_EMOJI_CONSTRAINT: NerdConstraint;
|
|
206
|
+
constrainGlyphBox: (box: {
|
|
207
|
+
x: number;
|
|
208
|
+
y: number;
|
|
209
|
+
width: number;
|
|
210
|
+
height: number;
|
|
211
|
+
}, constraint: NerdConstraint, metrics: NerdMetrics, constraintWidth: number) => {
|
|
212
|
+
x: number;
|
|
213
|
+
y: number;
|
|
214
|
+
width: number;
|
|
215
|
+
height: number;
|
|
216
|
+
};
|
|
217
|
+
tightenNerdConstraintBox: (box: {
|
|
218
|
+
x: number;
|
|
219
|
+
y: number;
|
|
220
|
+
width: number;
|
|
221
|
+
height: number;
|
|
222
|
+
}, constraint: NerdConstraint | null) => {
|
|
223
|
+
x: number;
|
|
224
|
+
y: number;
|
|
225
|
+
width: number;
|
|
226
|
+
height: number;
|
|
227
|
+
};
|
|
228
|
+
fontEntryHasItalicStyle: (entry: FontEntry) => boolean;
|
|
229
|
+
fontEntryHasBoldStyle: (entry: FontEntry) => boolean;
|
|
230
|
+
ITALIC_SLANT: number;
|
|
231
|
+
BOLD_OFFSET: number;
|
|
232
|
+
GLYPH_RENDER_MODE_COLOR: number;
|
|
233
|
+
GLYPH_RENDER_MODE_MONO: number;
|
|
234
|
+
};
|
|
235
|
+
export type RuntimeTickDeps = SharedTickDeps & {
|
|
236
|
+
isShaderStagesDirty: () => boolean;
|
|
237
|
+
rebuildWebGPUShaderStages: (state: WebGPUState) => void;
|
|
238
|
+
setShaderStagesDirty: (value: boolean) => void;
|
|
239
|
+
getCompiledWebGPUShaderStages: () => CompiledWebGPUShaderStage[];
|
|
240
|
+
ensureWebGPUStageTargets: (state: WebGPUState) => WebGPUStageTargets | null;
|
|
241
|
+
fontError: Error | null;
|
|
242
|
+
termDebug: HTMLElement | null;
|
|
243
|
+
reportDebugText: (text: string) => void;
|
|
244
|
+
updateGrid: () => void;
|
|
245
|
+
getRenderState: () => RenderState | null;
|
|
246
|
+
clearKittyOverlay: () => void;
|
|
247
|
+
resolveBlendFlags: (alphaMode: string, backend: "webgpu", state: WebGPUState) => {
|
|
248
|
+
useLinearBlending: boolean;
|
|
249
|
+
useLinearCorrection: boolean;
|
|
250
|
+
};
|
|
251
|
+
alphaBlending: string;
|
|
252
|
+
srgbToLinearColor: (color: Color) => Color;
|
|
253
|
+
reportTermSize: (cols: number, rows: number) => void;
|
|
254
|
+
resolveCursorPosition: (cursor: RenderState["cursor"]) => CursorPosition | null;
|
|
255
|
+
reportCursor: (cursor: {
|
|
256
|
+
col: number;
|
|
257
|
+
row: number;
|
|
258
|
+
} | null) => void;
|
|
259
|
+
FORCE_CURSOR_BLINK: boolean;
|
|
260
|
+
CURSOR_BLINK_MS: number;
|
|
261
|
+
imeInput: HTMLTextAreaElement | null;
|
|
262
|
+
resolveCursorStyle: (cursor: NonNullable<RenderState["cursor"]>, opts: {
|
|
263
|
+
focused: boolean;
|
|
264
|
+
preedit: boolean;
|
|
265
|
+
blinkVisible: boolean;
|
|
266
|
+
}) => number | null;
|
|
267
|
+
isFocused: boolean;
|
|
268
|
+
imeState: {
|
|
269
|
+
preedit: string;
|
|
270
|
+
selectionStart: number;
|
|
271
|
+
selectionEnd: number;
|
|
272
|
+
};
|
|
273
|
+
resolveImeAnchor: (cursor: CursorPosition | null, cols: number, rows: number) => {
|
|
274
|
+
row: number;
|
|
275
|
+
col: number;
|
|
276
|
+
} | null;
|
|
277
|
+
dbgEl: HTMLElement | null;
|
|
278
|
+
wasmExports: ResttyWasmExports | null;
|
|
279
|
+
wasmHandle: number;
|
|
280
|
+
gridState: {
|
|
281
|
+
cellW: number;
|
|
282
|
+
cellH: number;
|
|
283
|
+
fontSizePx: number;
|
|
284
|
+
scale: number;
|
|
285
|
+
lineHeight: number;
|
|
286
|
+
baselineOffset: number;
|
|
287
|
+
yPad: number;
|
|
288
|
+
};
|
|
289
|
+
canvas: HTMLCanvasElement;
|
|
290
|
+
updateImePosition: (cursor: {
|
|
291
|
+
row: number;
|
|
292
|
+
col: number;
|
|
293
|
+
}, cellW: number, cellH: number) => void;
|
|
294
|
+
lastRenderState: RenderState | null;
|
|
295
|
+
};
|
|
296
|
+
export type EmitWebGPUQueuedGlyphsParams = {
|
|
297
|
+
deps: SharedTickDeps;
|
|
298
|
+
state: WebGPUState;
|
|
299
|
+
frame: WebGPUFrame;
|
|
300
|
+
queueByFont: Map<number, GlyphQueueItem[]>;
|
|
301
|
+
targetMaps: {
|
|
302
|
+
nearest: Map<number, number[]>;
|
|
303
|
+
linear: Map<number, number[]>;
|
|
304
|
+
};
|
|
305
|
+
cellW: number;
|
|
306
|
+
cellH: number;
|
|
307
|
+
yPad: number;
|
|
308
|
+
baselineOffset: number;
|
|
309
|
+
primaryScale: number;
|
|
310
|
+
};
|
|
311
|
+
export type CollectWebGPUCellPassParams = {
|
|
312
|
+
deps: SharedTickDeps;
|
|
313
|
+
render: WebGPURenderInput;
|
|
314
|
+
cellW: number;
|
|
315
|
+
cellH: number;
|
|
316
|
+
fontSizePx: number;
|
|
317
|
+
primaryScale: number;
|
|
318
|
+
lineHeight: number;
|
|
319
|
+
baselineOffset: number;
|
|
320
|
+
yPad: number;
|
|
321
|
+
underlineOffsetPx: number;
|
|
322
|
+
underlineThicknessPx: number;
|
|
323
|
+
cursorBlock: boolean;
|
|
324
|
+
cursorCell: {
|
|
325
|
+
row: number;
|
|
326
|
+
col: number;
|
|
327
|
+
wide: boolean;
|
|
328
|
+
} | null;
|
|
329
|
+
blinkVisible: boolean;
|
|
330
|
+
defaultBg: Color;
|
|
331
|
+
};
|
|
332
|
+
export type AugmentWebGPUFrameParams = {
|
|
333
|
+
deps: SharedTickDeps & {
|
|
334
|
+
canvas: HTMLCanvasElement;
|
|
335
|
+
imeState: RuntimeTickDeps["imeState"];
|
|
336
|
+
};
|
|
337
|
+
state: WebGPUState;
|
|
338
|
+
frame: WebGPUFrame;
|
|
339
|
+
cursor: RenderState["cursor"];
|
|
340
|
+
cursorImeAnchor: {
|
|
341
|
+
row: number;
|
|
342
|
+
col: number;
|
|
343
|
+
} | null;
|
|
344
|
+
cursorCell: {
|
|
345
|
+
row: number;
|
|
346
|
+
col: number;
|
|
347
|
+
wide: boolean;
|
|
348
|
+
} | null;
|
|
349
|
+
cols: number;
|
|
350
|
+
cellW: number;
|
|
351
|
+
cellH: number;
|
|
352
|
+
yPad: number;
|
|
353
|
+
baselineOffset: number;
|
|
354
|
+
underlineOffsetPx: number;
|
|
355
|
+
underlineThicknessPx: number;
|
|
356
|
+
lineHeight: number;
|
|
357
|
+
primaryScale: number;
|
|
358
|
+
fontSizePx: number;
|
|
359
|
+
};
|
|
360
|
+
export type DrawWebGPUFrameParams = {
|
|
361
|
+
deps: SharedTickDeps & {
|
|
362
|
+
wasmHandle: number;
|
|
363
|
+
wasmExports: ResttyWasmExports | null;
|
|
364
|
+
canvas: HTMLCanvasElement;
|
|
365
|
+
};
|
|
366
|
+
state: WebGPUState;
|
|
367
|
+
frame: WebGPUFrame;
|
|
368
|
+
cursor: RenderState["cursor"];
|
|
369
|
+
cursorPos: CursorPosition | null;
|
|
370
|
+
cursorStyle: number | null;
|
|
371
|
+
rows: number;
|
|
372
|
+
cols: number;
|
|
373
|
+
cellW: number;
|
|
374
|
+
cellH: number;
|
|
375
|
+
yPad: number;
|
|
376
|
+
baselineOffset: number;
|
|
377
|
+
underlineOffsetPx: number;
|
|
378
|
+
underlineThicknessPx: number;
|
|
379
|
+
primaryScale: number;
|
|
380
|
+
useLinearBlending: boolean;
|
|
381
|
+
useLinearCorrection: boolean;
|
|
382
|
+
clearColor: Color;
|
|
383
|
+
hasShaderStages: boolean;
|
|
384
|
+
stageTargets: WebGPUStageTargets | null;
|
|
385
|
+
compiledWebGPUStages: CompiledWebGPUShaderStage[];
|
|
386
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WebGLState, WebGPUState } from "../../renderer";
|
|
2
|
+
import type { WebGLTickDeps } from "./render-tick-webgl.types";
|
|
3
|
+
import type { RuntimeTickDeps } from "./render-tick-webgpu.types";
|
|
4
|
+
type RuntimeRenderTickDeps = RuntimeTickDeps & WebGLTickDeps;
|
|
5
|
+
export declare function createRuntimeRenderTicks(deps: RuntimeRenderTickDeps): {
|
|
6
|
+
tickWebGPU: (state: WebGPUState) => void;
|
|
7
|
+
tickWebGL: (state: WebGLState) => void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { InputHandler } from "../../input";
|
|
2
|
+
import { type WebGPUState, type WebGLState } from "../../renderer";
|
|
3
|
+
import type { PtyTransport } from "../../pty";
|
|
4
|
+
import { type GhosttyTheme } from "../../theme";
|
|
5
|
+
import type { ResttyWasm, ResttyWasmExports } from "../../wasm";
|
|
6
|
+
import type { ResttyApp, ResttyAppCallbacks, ResttyAppSession } from "../types";
|
|
7
|
+
import type { PtyInputRuntime } from "./pty-input-runtime";
|
|
8
|
+
import type { RuntimeInteraction } from "./interaction-runtime";
|
|
9
|
+
export type RuntimeAppApiSharedState = {
|
|
10
|
+
wasm: ResttyWasm | null;
|
|
11
|
+
wasmExports: ResttyWasmExports | null;
|
|
12
|
+
wasmHandle: number;
|
|
13
|
+
wasmReady: boolean;
|
|
14
|
+
activeState: WebGPUState | WebGLState | null;
|
|
15
|
+
needsRender: boolean;
|
|
16
|
+
lastRenderTime: number;
|
|
17
|
+
currentContextType: "webgpu" | "webgl2" | null;
|
|
18
|
+
isFocused: boolean;
|
|
19
|
+
lastKeydownSeq: string;
|
|
20
|
+
lastKeydownSeqAt: number;
|
|
21
|
+
};
|
|
22
|
+
type PreferredRenderer = "auto" | "webgpu" | "webgl2";
|
|
23
|
+
type RuntimeSendInput = (text: string, source?: string, options?: {
|
|
24
|
+
skipHooks?: boolean;
|
|
25
|
+
}) => void;
|
|
26
|
+
type RuntimePublicApiOptions = {
|
|
27
|
+
setFontSize: ResttyApp["setFontSize"];
|
|
28
|
+
setFontSources: ResttyApp["setFontSources"];
|
|
29
|
+
resetTheme: ResttyApp["resetTheme"];
|
|
30
|
+
dumpAtlasForCodepoint: ResttyApp["dumpAtlasForCodepoint"];
|
|
31
|
+
resize: ResttyApp["resize"];
|
|
32
|
+
focus: ResttyApp["focus"];
|
|
33
|
+
blur: ResttyApp["blur"];
|
|
34
|
+
updateSize: ResttyApp["updateSize"];
|
|
35
|
+
setShaderStages: ResttyApp["setShaderStages"];
|
|
36
|
+
getShaderStages: ResttyApp["getShaderStages"];
|
|
37
|
+
};
|
|
38
|
+
export type RuntimeAppApiRuntime = {
|
|
39
|
+
sendInput: RuntimeSendInput;
|
|
40
|
+
createPublicApi: (options: RuntimePublicApiOptions) => ResttyApp;
|
|
41
|
+
};
|
|
42
|
+
type LifecycleThemeRuntime = {
|
|
43
|
+
cancelScheduledSizeUpdate: () => void;
|
|
44
|
+
getActiveTheme: () => GhosttyTheme | null;
|
|
45
|
+
};
|
|
46
|
+
type CreateRuntimeAppApiOptions = {
|
|
47
|
+
session: ResttyAppSession;
|
|
48
|
+
ptyTransport: PtyTransport;
|
|
49
|
+
inputHandler: InputHandler;
|
|
50
|
+
ptyInputRuntime: PtyInputRuntime;
|
|
51
|
+
interaction: RuntimeInteraction;
|
|
52
|
+
lifecycleThemeSizeRuntime: LifecycleThemeRuntime;
|
|
53
|
+
cleanupFns: Array<() => void>;
|
|
54
|
+
cleanupCanvasFns: Array<() => void>;
|
|
55
|
+
callbacks?: ResttyAppCallbacks;
|
|
56
|
+
fpsEl: HTMLElement | null;
|
|
57
|
+
backendEl: HTMLElement | null;
|
|
58
|
+
inputDebugEl: HTMLElement | null;
|
|
59
|
+
imeInput: HTMLTextAreaElement | null;
|
|
60
|
+
attachWindowEvents: boolean;
|
|
61
|
+
isMacPlatform: boolean;
|
|
62
|
+
textEncoder: TextEncoder;
|
|
63
|
+
readState: () => RuntimeAppApiSharedState;
|
|
64
|
+
writeState: (patch: Partial<RuntimeAppApiSharedState>) => void;
|
|
65
|
+
appendLog: (line: string) => void;
|
|
66
|
+
shouldSuppressWasmLog: (text: string) => boolean;
|
|
67
|
+
runBeforeInputHook: (text: string, source: string) => string | null;
|
|
68
|
+
runBeforeRenderOutputHook: (text: string, source: string) => string | null;
|
|
69
|
+
getSelectionText: () => string;
|
|
70
|
+
initialPreferredRenderer: PreferredRenderer;
|
|
71
|
+
CURSOR_BLINK_MS: number;
|
|
72
|
+
RESIZE_ACTIVE_MS: number;
|
|
73
|
+
TARGET_RENDER_FPS: number;
|
|
74
|
+
BACKGROUND_RENDER_FPS: number;
|
|
75
|
+
KITTY_FLAG_REPORT_EVENTS: number;
|
|
76
|
+
resizeState: {
|
|
77
|
+
lastAt: number;
|
|
78
|
+
};
|
|
79
|
+
flushPendingTerminalResize: () => void;
|
|
80
|
+
tickWebGPU: (state: WebGPUState) => void;
|
|
81
|
+
tickWebGL: (state: WebGLState) => void;
|
|
82
|
+
updateGrid: () => void;
|
|
83
|
+
gridState: {
|
|
84
|
+
cols: number;
|
|
85
|
+
rows: number;
|
|
86
|
+
};
|
|
87
|
+
getCanvas: () => HTMLCanvasElement;
|
|
88
|
+
applyTheme: ResttyApp["applyTheme"];
|
|
89
|
+
ensureFont: () => Promise<void>;
|
|
90
|
+
updateSize: ResttyApp["updateSize"];
|
|
91
|
+
log: (line: string) => void;
|
|
92
|
+
replaceCanvas: () => void;
|
|
93
|
+
rebuildWebGPUShaderStages: (state: WebGPUState) => void;
|
|
94
|
+
rebuildWebGLShaderStages: (state: WebGLState) => void;
|
|
95
|
+
setShaderStagesDirty: (dirty: boolean) => void;
|
|
96
|
+
clearWebGPUShaderStages: () => void;
|
|
97
|
+
destroyWebGPUStageTargets: () => void;
|
|
98
|
+
clearWebGLShaderStages: (state?: WebGLState) => void;
|
|
99
|
+
destroyWebGLStageTargets: (state?: WebGLState) => void;
|
|
100
|
+
resetTerminalResizeScheduler: () => void;
|
|
101
|
+
};
|
|
102
|
+
export declare function createRuntimeAppApi(options: CreateRuntimeAppApiOptions): RuntimeAppApiRuntime;
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type RuntimeLogFilter = {
|
|
2
|
+
re: RegExp;
|
|
3
|
+
note: string;
|
|
4
|
+
};
|
|
5
|
+
export type CreateRuntimeLoggerOptions = {
|
|
6
|
+
logEl?: HTMLElement | null;
|
|
7
|
+
onLog?: ((entry: string) => void) | null;
|
|
8
|
+
logLimit?: number;
|
|
9
|
+
wasmLogFilters?: RuntimeLogFilter[];
|
|
10
|
+
};
|
|
11
|
+
export type RuntimeLogger = {
|
|
12
|
+
log: (msg: string) => void;
|
|
13
|
+
appendLog: (line: string) => void;
|
|
14
|
+
shouldSuppressWasmLog: (text: string) => boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function createRuntimeLogger(options: CreateRuntimeLoggerOptions): RuntimeLogger;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CursorInfo, RenderState, ResttyWasm, ResttyWasmExports } from "../../wasm";
|
|
2
|
+
import type { ResttyAppCallbacks } from "../types";
|
|
3
|
+
import type { RuntimeSelectionState } from "./interaction-runtime/types";
|
|
4
|
+
export type CreateRuntimeReportingOptions = {
|
|
5
|
+
selectionState: RuntimeSelectionState;
|
|
6
|
+
getLastRenderState: () => RenderState | null;
|
|
7
|
+
getWasmReady: () => boolean;
|
|
8
|
+
getWasm: () => ResttyWasm | null;
|
|
9
|
+
getWasmHandle: () => number;
|
|
10
|
+
getWasmExports: () => ResttyWasmExports | null;
|
|
11
|
+
callbacks?: ResttyAppCallbacks;
|
|
12
|
+
termSizeEl: HTMLElement | null;
|
|
13
|
+
cursorPosEl: HTMLElement | null;
|
|
14
|
+
dbgEl: HTMLElement | null;
|
|
15
|
+
setCursorForCpr: (pos: {
|
|
16
|
+
row: number;
|
|
17
|
+
col: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare function createRuntimeReporting(options: CreateRuntimeReportingOptions): {
|
|
21
|
+
selectionForRow: (row: number, cols: number) => import("../../selection").SelectionRange;
|
|
22
|
+
getSelectionText: () => string;
|
|
23
|
+
getRenderState: () => RenderState | null;
|
|
24
|
+
resolveCursorPosition: (cursor: CursorInfo | null) => {
|
|
25
|
+
col: number;
|
|
26
|
+
row: number;
|
|
27
|
+
wideTail: boolean;
|
|
28
|
+
};
|
|
29
|
+
resolveCursorStyle: (cursor: CursorInfo | null, opts: {
|
|
30
|
+
focused: boolean;
|
|
31
|
+
preedit: boolean;
|
|
32
|
+
blinkVisible: boolean;
|
|
33
|
+
}) => number | null;
|
|
34
|
+
reportTermSize: (cols: number, rows: number) => void;
|
|
35
|
+
reportCursor: (cursorPos: {
|
|
36
|
+
col: number;
|
|
37
|
+
row: number;
|
|
38
|
+
} | null) => void;
|
|
39
|
+
reportDebugText: (text: string) => void;
|
|
40
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WebGPUState, WebGLState } from "../../renderer";
|
|
2
|
+
import type { CompiledWebGPUShaderStage, WebGPUStageTargets, CompiledWebGLShaderStage, WebGLStageTargets } from "../create-app-types";
|
|
3
|
+
import type { ResttyShaderStage } from "../types";
|
|
4
|
+
export type CreateShaderStageRuntimeOptions = {
|
|
5
|
+
appendLog: (line: string) => void;
|
|
6
|
+
getCanvasSize: () => {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
getActiveWebGLState: () => WebGLState | null;
|
|
11
|
+
onShaderStagesChanged: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type ShaderStageRuntime = {
|
|
14
|
+
setShaderStages: (stages: ResttyShaderStage[]) => void;
|
|
15
|
+
getShaderStages: () => ResttyShaderStage[];
|
|
16
|
+
isShaderStagesDirty: () => boolean;
|
|
17
|
+
setShaderStagesDirty: (value: boolean) => void;
|
|
18
|
+
getCompiledWebGPUShaderStages: () => CompiledWebGPUShaderStage[];
|
|
19
|
+
getCompiledWebGLShaderStages: () => CompiledWebGLShaderStage[];
|
|
20
|
+
clearWebGPUShaderStages: () => void;
|
|
21
|
+
clearWebGLShaderStages: (state?: WebGLState | null) => void;
|
|
22
|
+
destroyWebGPUStageTargets: () => void;
|
|
23
|
+
destroyWebGLStageTargets: (state?: WebGLState | null) => void;
|
|
24
|
+
ensureWebGPUStageTargets: (state: WebGPUState) => WebGPUStageTargets | null;
|
|
25
|
+
ensureWebGLStageTargets: (state: WebGLState) => WebGLStageTargets | null;
|
|
26
|
+
rebuildWebGPUShaderStages: (state: WebGPUState) => void;
|
|
27
|
+
rebuildWebGLShaderStages: (state: WebGLState) => void;
|
|
28
|
+
};
|
|
29
|
+
export declare function createShaderStageRuntime(options: CreateShaderStageRuntimeOptions): ShaderStageRuntime;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ResttyApp, ResttyAppOptions } from "./types";
|
|
2
|
+
export { createResttyAppSession, getDefaultResttyAppSession } from "./session";
|
|
3
|
+
export { createResttyPaneManager, } from "../surface/panes/manager";
|
|
4
|
+
export { createDefaultResttyPaneContextMenuItems, getResttyShortcutModifierLabel, } from "../surface/panes/default-context-menu-items";
|
|
5
|
+
export type { ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyFontSource, ResttyTouchSelectionMode, ResttyUrlFontSource, ResttyBufferFontSource, ResttyLocalFontSource, ResttyWasmLogListener, ResttyAppSession, ResttyAppInputPayload, ResttyShaderStage, ResttyShaderStageMode, ResttyShaderStageBackend, ResttyShaderStageSource, ResttyAppOptions, ResttyApp, } from "./types";
|
|
6
|
+
export type { ResttyPaneSplitDirection, ResttyPaneContextMenuItem, ResttyPaneDefinition, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneShortcutsOptions, ResttyPaneContextMenuOptions, CreateResttyPaneManagerOptions, ResttyPaneManager, ResttyPaneWithApp, CreateDefaultResttyPaneContextMenuItemsOptions, } from "../surface/panes-types";
|
|
7
|
+
export declare function createResttyApp(options: ResttyAppOptions): ResttyApp;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FontAtlasBitmap } from "../../fonts";
|
|
2
|
+
export declare function bitmapBytesPerPixel(pixelMode: number): number;
|
|
3
|
+
export declare function createAtlasBitmap(width: number, height: number, pixelMode: FontAtlasBitmap["pixelMode"]): FontAtlasBitmap;
|
|
4
|
+
export declare function cloneBitmap(bitmap: FontAtlasBitmap | null | undefined, defaultPixelMode?: FontAtlasBitmap["pixelMode"]): FontAtlasBitmap;
|
|
5
|
+
export declare function copyBitmapToAtlas(src: FontAtlasBitmap, dst: FontAtlasBitmap, dstX: number, dstY: number): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Font, type FontAtlas, type FontSizeMode } from "../../fonts";
|
|
2
|
+
import type { GlyphConstraintMeta, AtlasConstraintContext } from "../atlas-builder";
|
|
3
|
+
import type { GlyphRasterizeOptions, Matrix2D, Matrix3x3, RasterizedGlyph } from "text-shaper";
|
|
4
|
+
export type RasterizeGlyphTransformOptions = GlyphRasterizeOptions & {
|
|
5
|
+
offsetX26?: number;
|
|
6
|
+
offsetY26?: number;
|
|
7
|
+
};
|
|
8
|
+
export type RasterizeGlyphFn = (font: Font, glyphId: number, fontSize: number, options?: GlyphRasterizeOptions) => RasterizedGlyph | null;
|
|
9
|
+
export type RasterizeGlyphWithTransformFn = (font: Font, glyphId: number, fontSize: number, matrix: Matrix2D | Matrix3x3, options?: RasterizeGlyphTransformOptions) => RasterizedGlyph | null;
|
|
10
|
+
export type BuildGlyphAtlasWithConstraintsOptions = {
|
|
11
|
+
font: Font;
|
|
12
|
+
glyphIds: number[];
|
|
13
|
+
fontSize: number;
|
|
14
|
+
sizeMode: FontSizeMode;
|
|
15
|
+
padding: number;
|
|
16
|
+
maxWidth: number;
|
|
17
|
+
maxHeight: number;
|
|
18
|
+
pixelMode: number;
|
|
19
|
+
hinting: boolean;
|
|
20
|
+
rasterizeGlyph?: RasterizeGlyphFn;
|
|
21
|
+
rasterizeGlyphWithTransform?: RasterizeGlyphWithTransformFn;
|
|
22
|
+
glyphMeta?: Map<number, GlyphConstraintMeta>;
|
|
23
|
+
constraintContext?: AtlasConstraintContext;
|
|
24
|
+
};
|
|
25
|
+
export type BuildGlyphAtlasWithConstraintsResult = {
|
|
26
|
+
atlas: FontAtlas | null;
|
|
27
|
+
constrainedGlyphWidths: Map<number, number> | null;
|
|
28
|
+
};
|
|
29
|
+
export declare function buildGlyphAtlasWithConstraints(options: BuildGlyphAtlasWithConstraintsOptions): BuildGlyphAtlasWithConstraintsResult;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Font } from "../../fonts";
|
|
2
|
+
import type { GlyphConstraintMeta, AtlasConstraintContext } from "../atlas-builder";
|
|
3
|
+
export declare function resolveFontScaleForAtlas(font: Font | null | undefined, fontSize: number, sizeMode?: "em" | "height" | null): number;
|
|
4
|
+
export declare function fontCapHeightUnits(font: Font | null | undefined): number;
|
|
5
|
+
export declare function buildNerdMetrics(cellW: number, cellH: number, lineHeight: number, primaryFont: Font | null | undefined, primaryScale: number, iconScale: number): {
|
|
6
|
+
cellWidth: number;
|
|
7
|
+
cellHeight: number;
|
|
8
|
+
faceWidth: number;
|
|
9
|
+
faceHeight: number;
|
|
10
|
+
faceY: number;
|
|
11
|
+
iconHeight: number;
|
|
12
|
+
iconHeightSingle: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function nerdConstraintSignature(glyphMeta?: Map<number, GlyphConstraintMeta>, constraintContext?: AtlasConstraintContext | null): string;
|
|
15
|
+
export declare function tightenNerdConstraintBox(box: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}, constraint: import("../../fonts").NerdConstraint | null): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function nextPowerOf2(n: number): number;
|
|
2
|
+
export declare function packGlyphs(sizes: Array<{
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}>, maxWidth: number, maxHeight: number): {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
placements: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
placed: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
};
|