GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stacki/src/lib/screenshotSource.ts at main · flowtricks/stacki

Expand file tree

/

screenshotSource.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
48 lines (42 loc) · 2.02 KB
/

screenshotSource.ts

Copy path

File metadata and controls

48 lines (42 loc) · 2.02 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Where the AI composer's screenshots learn what the canvas shows (docs/contracts.md, "Screenshots").
// The composer lives in the AI feature, the canvas in the preview feature and the selection in the
// shell, and features may not import each other: the Desktop shell installs a source here while a
// project is open (src/app/shell/aiScreenshotSource.ts), and the composer asks through this one seam.
// With nothing installed, region captures of the window still work; each is then a panel capture.
/** A region of the window, in its CSS pixels, rounded outwards to whole pixels. */
export interface WindowRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}
/** The canvas as the window shows it: where it sits and the breakpoint width it renders at. */
export interface CanvasTarget {
readonly rect: WindowRect;
readonly breakpointPx: number;
}
/** What the shell installs. */
export interface ScreenshotSource {
/** The part of the window the canvas shows and its breakpoint width, or undefined with no visible canvas; tells a canvas region from a panel one. */
readonly canvas: () => CanvasTarget | undefined;
/**
* Readies the canvas for a capture until the returned call restores it: the last hovered node stays outlined (the pointer
* has left the canvas for the screenshot button), and the editor's transient tooltips step aside. Selected outlines, tag
* labels and text marks are the canvas's own and are never hidden: the capture shows what the person sees.
*/
readonly prepare: () => () => void;
}
let source: ScreenshotSource | undefined;
/** Installs the shell's source; returns the uninstall, which leaves a newer source in place. */
export function setScreenshotSource(next: ScreenshotSource): () => void {
source = next;
return () => {
if (source === next) {
source = undefined;
}
};
}
/** The installed source, or undefined outside Desktop's editor. */
export function screenshotSource(): ScreenshotSource | undefined {
return source;
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.