@tarve/core 0.5.0 → 0.6.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.
- package/CHANGELOG.md +46 -0
- package/README.md +54 -2
- package/dist/npm/build.js +714 -138
- package/dist/npm/cli.js +1013 -161
- package/dist/npm/embedded-assets.js +7 -2
- package/dist/npm/index.js +3096 -1084
- package/dist/npm/jsx-dev-runtime.js +1268 -0
- package/dist/npm/jsx-runtime.js +1268 -0
- package/dist/npm/native-runtime.json +3 -3
- package/dist/npm/node-build.js +299 -5
- package/dist/npm/protocol.js +1 -1
- package/dist/npm/txiki/fetch.ts +228 -0
- package/dist/npm/txiki/intl-data.ts +7 -0
- package/dist/npm/txiki/intl.test.ts +53 -0
- package/dist/npm/txiki/intl.ts +249 -0
- package/dist/npm/txiki/prelude.ts +132 -0
- package/dist/npm/txiki/runtime.ts +6 -0
- package/dist/npm/txiki/shims/buffer.ts +112 -0
- package/dist/npm/txiki/shims/child-process.ts +151 -0
- package/dist/npm/txiki/shims/crypto.ts +30 -0
- package/dist/npm/txiki/shims/events.ts +75 -0
- package/dist/npm/txiki/shims/fs-promises.ts +77 -0
- package/dist/npm/txiki/shims/fs.ts +231 -0
- package/dist/npm/txiki/shims/module.ts +8 -0
- package/dist/npm/txiki/shims/net.ts +69 -0
- package/dist/npm/txiki/shims/os.ts +72 -0
- package/dist/npm/txiki/shims/path.ts +4 -0
- package/dist/npm/txiki/shims/timers-promises.ts +9 -0
- package/dist/npm/txiki/shims/zlib.ts +9 -0
- package/dist/npm/txiki/tjs.d.ts +58 -0
- package/dist/npm/txiki/unavailable.ts +10 -0
- package/dist/types/core/build.d.ts +5 -2
- package/dist/types/core/jsx-compile.d.ts +7 -0
- package/dist/types/core/src/advanced-controls.d.ts +1 -1
- package/dist/types/core/src/app/element-events.d.ts +18 -0
- package/dist/types/core/src/app/media.d.ts +15 -0
- package/dist/types/core/src/app/requests.d.ts +25 -0
- package/dist/types/core/src/app/shadow.d.ts +7 -0
- package/dist/types/core/src/app/stats.d.ts +12 -0
- package/dist/types/core/src/app/tray.d.ts +40 -0
- package/dist/types/core/src/app-metadata.d.ts +2 -0
- package/dist/types/core/src/app.d.ts +29 -27
- package/dist/types/core/src/bridge/index.d.ts +1 -1
- package/dist/types/core/src/chat-controls.d.ts +2 -1
- package/dist/types/core/src/components/button.d.ts +1 -1
- package/dist/types/core/src/components/glass.d.ts +52 -0
- package/dist/types/core/src/components/icon.d.ts +1 -1
- package/dist/types/core/src/components/image.d.ts +1 -1
- package/dist/types/core/src/components/layout.d.ts +1 -1
- package/dist/types/core/src/components/pressable.d.ts +1 -1
- package/dist/types/core/src/components/rich-content.d.ts +1 -1
- package/dist/types/core/src/components/scroll.d.ts +2 -2
- package/dist/types/core/src/components/svg.d.ts +1 -1
- package/dist/types/core/src/components/titlebar.d.ts +15 -1
- package/dist/types/core/src/components/window.d.ts +21 -1
- package/dist/types/core/src/components.d.ts +2 -0
- package/dist/types/core/src/css-shadow.d.ts +1 -1
- package/dist/types/core/src/desktop-controls.d.ts +2 -2
- package/dist/types/core/src/embedded-assets.d.ts +3 -2
- package/dist/types/core/src/extra-controls.d.ts +1 -1
- package/dist/types/core/src/form-controls.d.ts +1 -1
- package/dist/types/core/src/index.d.ts +20 -11
- package/dist/types/core/src/inline-text.d.ts +7 -3
- package/dist/types/core/src/intrinsic-style.d.ts +1 -1
- package/dist/types/core/src/jsx-runtime.d.ts +10 -4
- package/dist/types/core/src/media-element.d.ts +3 -4
- package/dist/types/core/src/memo.d.ts +10 -0
- package/dist/types/core/src/motion.d.ts +1 -1
- package/dist/types/core/src/popups.d.ts +1 -1
- package/dist/types/core/src/protocol.d.ts +6 -0
- package/dist/types/core/src/reconciler/diff.d.ts +11 -0
- package/dist/types/core/src/reconciler/intrinsics.d.ts +24 -0
- package/dist/types/core/src/reconciler.d.ts +10 -11
- package/dist/types/core/src/render-scope.d.ts +8 -0
- package/dist/types/core/src/style.d.ts +1 -1
- package/dist/types/core/src/tailwind-palette.d.ts +1 -0
- package/dist/types/core/src/tailwind.d.ts +8 -0
- package/dist/types/core/src/test-renderer.d.ts +1 -1
- package/dist/types/core/src/text-search.d.ts +1 -1
- package/dist/types/core/src/theme.d.ts +8 -1
- package/dist/types/core/src/updates.d.ts +87 -0
- package/dist/types/core/src/virtual-list.d.ts +3 -1
- package/dist/types/core/txiki/fetch.d.ts +1 -0
- package/dist/types/core/txiki/intl-data.d.ts +6 -0
- package/dist/types/core/txiki/intl.d.ts +92 -0
- package/dist/types/core/txiki/prelude.d.ts +1 -0
- package/dist/types/core/txiki/runtime.d.ts +2 -0
- package/dist/types/core/txiki/shims/buffer.d.ts +37 -0
- package/dist/types/core/txiki/shims/child-process.d.ts +46 -0
- package/dist/types/core/txiki/shims/crypto.d.ts +16 -0
- package/dist/types/core/txiki/shims/events.d.ts +21 -0
- package/dist/types/core/txiki/shims/fs-promises.d.ts +41 -0
- package/dist/types/core/txiki/shims/fs.d.ts +44 -0
- package/dist/types/core/txiki/shims/module.d.ts +5 -0
- package/dist/types/core/txiki/shims/net.d.ts +22 -0
- package/dist/types/core/txiki/shims/os.d.ts +52 -0
- package/dist/types/core/txiki/shims/path.d.ts +3 -0
- package/dist/types/core/txiki/shims/timers-promises.d.ts +7 -0
- package/dist/types/core/txiki/shims/zlib.d.ts +11 -0
- package/dist/types/core/txiki/unavailable.d.ts +5 -0
- package/dist/types/core/txiki-build.d.ts +23 -0
- package/dist/types/core/updates-build.d.ts +35 -0
- package/dist/types/protocol/src/index.d.ts +159 -8
- package/native/linux-x64/libtarve_native.so +0 -0
- package/native/linux-x64/runtime.json +4 -4
- package/native/win32-x64/runtime.json +4 -4
- package/native/win32-x64/tarve_native.dll +0 -0
- package/package.json +3 -2
- /package/dist/types/core/{app-metadata.d.ts → package-metadata.d.ts} +0 -0
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
import type { Style } from "../protocol";
|
|
1
2
|
import { type VNode } from "../jsx-runtime";
|
|
2
3
|
import { type ViewProps } from "./layout";
|
|
4
|
+
import { type GlassVariant } from "./glass";
|
|
3
5
|
export interface TitleBarProps extends ViewProps {
|
|
4
6
|
title?: string;
|
|
5
7
|
height?: number;
|
|
6
8
|
showMinimize?: boolean;
|
|
7
9
|
showMaximize?: boolean;
|
|
8
10
|
showClose?: boolean;
|
|
11
|
+
/** Style merged into each window control (minimize, maximize, close): size, radius, colours. */
|
|
12
|
+
buttonStyle?: Style;
|
|
13
|
+
/**
|
|
14
|
+
* Liquid Glass bar: `true` for the `regular` material, or a variant. Its controls go
|
|
15
|
+
* round. Edge to edge (no `radius` in `style`) it keeps only a hairline along its bottom;
|
|
16
|
+
* with a `radius` it is a floating capsule with the full rim and shadow. Lay it over
|
|
17
|
+
* content (`position: "absolute"`) for the backdrop to show through, as the window
|
|
18
|
+
* background alone is only the veil.
|
|
19
|
+
*/
|
|
20
|
+
glass?: boolean | GlassVariant;
|
|
21
|
+
/** Light or dark glass; sets the ink of the title and controls. Default `light`. */
|
|
22
|
+
appearance?: "light" | "dark";
|
|
9
23
|
}
|
|
10
|
-
export declare function TitleBar({ title, height, showMinimize, showMaximize, showClose, children, style, ...props }: TitleBarProps): VNode;
|
|
24
|
+
export declare function TitleBar({ title, height, showMinimize, showMaximize, showClose, buttonStyle, glass, appearance, children, style, ...props }: TitleBarProps): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WindowPosition } from "
|
|
1
|
+
import type { DesktopWidget, WindowLevel, WindowPosition } from "../protocol";
|
|
2
2
|
import type { VNode } from "../jsx-runtime";
|
|
3
3
|
import { type ThemeDefinition } from "../theme";
|
|
4
4
|
import { type ViewProps } from "./layout";
|
|
@@ -10,6 +10,26 @@ export interface WindowProps extends ViewProps {
|
|
|
10
10
|
minHeight?: number;
|
|
11
11
|
resizable?: boolean;
|
|
12
12
|
position?: WindowPosition;
|
|
13
|
+
/**
|
|
14
|
+
* Stacking order; `alwaysOnBottom` keeps the window under every other one, even
|
|
15
|
+
* when clicked or shown. Can change while the app runs.
|
|
16
|
+
*/
|
|
17
|
+
level?: WindowLevel;
|
|
18
|
+
/** Keep the window off the taskbar and out of Alt+Tab (Windows) or the task switcher and pager (Linux, X11). */
|
|
19
|
+
skipTaskbar?: boolean;
|
|
20
|
+
/** No native frame or title bar, without needing a `TitleBar`. Pair with a `dragRegion` to move it. */
|
|
21
|
+
frameless?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Make the window a desktop widget, `columns` × `rows` cells: frameless, below
|
|
24
|
+
* every window (unless `level` says otherwise) and off the taskbar.
|
|
25
|
+
* Windows: sized to the desktop icon grid; when dragged (give it a
|
|
26
|
+
* `dragRegion`) it drops into the nearest cells free of icons, and icons that
|
|
27
|
+
* land under it are moved out.
|
|
28
|
+
* Linux (X11; XWayland on a Wayland session): cells of a typical icon,
|
|
29
|
+
* 80 × 100, on every workspace; no icon grid to follow.
|
|
30
|
+
* `width`/`height` are ignored; `position` is where it first looks for room.
|
|
31
|
+
*/
|
|
32
|
+
desktopWidget?: DesktopWidget;
|
|
13
33
|
theme?: ThemeDefinition;
|
|
14
34
|
onCloseRequest?: (event: WindowCloseRequestEvent) => void;
|
|
15
35
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export { View, Row, Column, Portal } from "./components/layout";
|
|
8
8
|
export type { ViewProps, PortalProps } from "./components/layout";
|
|
9
|
+
export { Glass, glassChrome, glassSurface, over } from "./components/glass";
|
|
10
|
+
export type { GlassProps, GlassVariant } from "./components/glass";
|
|
9
11
|
export { Window } from "./components/window";
|
|
10
12
|
export type { WindowProps, WindowCloseRequestEvent } from "./components/window";
|
|
11
13
|
export { Pressable } from "./components/pressable";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BoxShadow, Gradient, TextShadow, Transform } from "
|
|
1
|
+
import type { BoxShadow, Gradient, TextShadow, Transform } from "./protocol";
|
|
2
2
|
/**
|
|
3
3
|
* CSS colour → "#rrggbbaa". Hex, rgb()/rgba(), hsl()/hsla() and a few names are
|
|
4
4
|
* converted; theme tokens (`var(--…)`) pass through for theme resolution.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Style } from "
|
|
1
|
+
import type { ScrollInfo, Style } from "./protocol";
|
|
2
2
|
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
3
3
|
import { type IconName } from "./components";
|
|
4
4
|
export interface TreeNode<T = unknown> {
|
|
@@ -56,7 +56,7 @@ export interface DataGridProps<T> extends BaseProps {
|
|
|
56
56
|
onSortChange?: (sort: DataGridSort | undefined) => void;
|
|
57
57
|
onSelectionChange?: (keys: DataGridKey[]) => void;
|
|
58
58
|
onRowActivate?: (row: T, index: number) => void;
|
|
59
|
-
onScroll?: (offset: number, max: number) => void;
|
|
59
|
+
onScroll?: (offset: number, max: number, info: ScrollInfo) => void;
|
|
60
60
|
}
|
|
61
61
|
/** Virtualized controlled data grid with local/manual sort, filtering and row selection. */
|
|
62
62
|
export declare function DataGrid<T>({ columns, rows, rowKey, height, rowHeight, offset, overscan, sort, sortMode, filter, filterMode, selectionMode, selectedKeys, empty, onSortChange, onSelectionChange, onRowActivate, onScroll, style, id, ...props }: DataGridProps<T>): VNode;
|
|
@@ -9,6 +9,7 @@ export interface AssetDigest {
|
|
|
9
9
|
* Give native libraries a physical path for an asset embedded in a Bun executable.
|
|
10
10
|
* With a build-time `digest`, a launch that finds the extracted copy at the
|
|
11
11
|
* expected size reuses it without reading or hashing the embedded bytes; the
|
|
12
|
-
* full hash check runs only when the copy is written.
|
|
12
|
+
* full hash check runs only when the copy is written. `digest` describes the
|
|
13
|
+
* decoded bytes; `encoding` names how the embedded copy is compressed (Bun only).
|
|
13
14
|
*/
|
|
14
|
-
export declare function materializeAsset(source: string, filename: string, digest?: AssetDigest): string;
|
|
15
|
+
export declare function materializeAsset(source: string, filename: string, digest?: AssetDigest, encoding?: "zstd"): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Style } from "
|
|
1
|
+
import type { Style } from "./protocol";
|
|
2
2
|
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
3
3
|
import { type ButtonProps } from "./components";
|
|
4
4
|
export interface SkeletonProps extends BaseProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { Window, View, Row, Column, Portal, Pressable, Link, Icon, Svg, Path, Circle, Ellipse, Line, Polyline, Polygon, SvgRect, Text, Markdown, Code, Diff, Button, Image, clearImageSourceCache, loadImageSource, Scroll, ScrollArea, Input, TextArea, TitleBar, Modal, Dialog } from "./components";
|
|
2
|
-
export type { WindowProps, WindowCloseRequestEvent, ViewProps, PortalProps, PressableProps, LinkProps, IconName, IconProps, SvgProps, SvgNode, SvgAttributes, PathProps, CircleProps, EllipseProps, LineProps, PolylineProps, PolygonProps, RectProps, TextProps, MarkdownProps, CodeProps, DiffProps, ButtonProps, ImageBytesSource, ImageHttpCacheMode, ImageProps, ImageRgbaSource, ImageSource, LoadImageSourceOptions, ScrollProps, ScrollAreaProps, InputType, InputProps, TextAreaProps, TitleBarProps, ModalProps, DialogProps } from "./components";
|
|
1
|
+
export { Window, View, Row, Column, Portal, Glass, glassChrome, glassSurface, Pressable, Link, Icon, Svg, Path, Circle, Ellipse, Line, Polyline, Polygon, SvgRect, Text, Markdown, Code, Diff, Button, Image, clearImageSourceCache, loadImageSource, Scroll, ScrollArea, Input, TextArea, TitleBar, Modal, Dialog, over } from "./components";
|
|
2
|
+
export type { WindowProps, WindowCloseRequestEvent, ViewProps, GlassProps, GlassVariant, PortalProps, PressableProps, LinkProps, IconName, IconProps, SvgProps, SvgNode, SvgAttributes, PathProps, CircleProps, EllipseProps, LineProps, PolylineProps, PolygonProps, RectProps, TextProps, MarkdownProps, CodeProps, DiffProps, ButtonProps, ImageBytesSource, ImageHttpCacheMode, ImageProps, ImageRgbaSource, ImageSource, LoadImageSourceOptions, ScrollProps, ScrollAreaProps, InputType, InputProps, TextAreaProps, TitleBarProps, ModalProps, DialogProps } from "./components";
|
|
3
3
|
export { Checkbox, Switch, RadioGroup, Slider, Card, Badge, Separator, Progress, Tabs, Accordion } from "./controls";
|
|
4
4
|
export type { CheckboxProps, SwitchProps, RadioOption, RadioGroupProps, SliderProps, CardProps, BadgeProps, SeparatorProps, ProgressProps, TabItem, TabsProps, AccordionItem, AccordionProps } from "./controls";
|
|
5
5
|
export { VirtualList } from "./virtual-list";
|
|
6
|
-
export { memo, shallowEqual } from "./memo";
|
|
6
|
+
export { memo, shallowEqual, template } from "./memo";
|
|
7
7
|
export type { VirtualListProps } from "./virtual-list";
|
|
8
8
|
export { AnimatePresence } from "./motion";
|
|
9
9
|
export type { AnimatePresenceProps } from "./motion";
|
|
@@ -11,18 +11,26 @@ export { List } from "./list";
|
|
|
11
11
|
export type { ListProps } from "./list";
|
|
12
12
|
export { Select } from "./select";
|
|
13
13
|
export type { SelectProps, SelectOption } from "./select";
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
14
|
+
export { Tooltip, Popover, DropdownMenu, ContextMenu, Combobox, Command, CommandPalette } from "./popups";
|
|
15
|
+
export type { PopupSide, TooltipProps, PopoverProps, DropdownMenuItem, DropdownMenuProps, ContextMenuProps, ComboboxOption, ComboboxProps, CommandItem, CommandProps, CommandPaletteProps } from "./popups";
|
|
16
|
+
export { Skeleton, Spinner, Avatar, Breadcrumb, Pagination, Calendar, DatePicker, Collapsible, Table, DataTable, AlertDialog, Sheet, Toast, Toaster, Menubar, HoverCard } from "./extra-controls";
|
|
17
|
+
export type { SkeletonProps, SpinnerProps, AvatarProps, BreadcrumbItem, BreadcrumbProps, PaginationProps, CalendarWeekStartsOn, CalendarProps, DatePickerProps, CollapsibleProps, TableColumn, TableProps, DataTableProps, AlertDialogProps, SheetSide, SheetProps, ToastVariant, ToastAction, ToastItem, ToastProps, ToasterPosition, ToasterProps, MenubarItem, MenubarMenu, MenubarProps, HoverCardSide, HoverCardProps } from "./extra-controls";
|
|
18
|
+
export { Alert, AspectRatio, ButtonGroup, Empty, Label, Field, InputGroup, InputOTP, Item, Kbd, NativeSelect, Toggle, ToggleGroup, Typography, Direction } from "./form-controls";
|
|
19
|
+
export type { AlertVariant, AlertProps, AspectRatioProps, ButtonGroupProps, EmptyProps, LabelProps, FieldProps, InputGroupProps, InputOTPProps, ItemProps, KbdProps, NativeSelectProps, ToggleProps, ToggleGroupItem, ToggleGroupProps, TypographyVariant, TypographyProps, DirectionProps } from "./form-controls";
|
|
20
|
+
export { Carousel, Chart, Drawer, NavigationMenu, Resizable, Sidebar, Questionnaire } from "./advanced-controls";
|
|
21
|
+
export type { CarouselItem, CarouselProps, ChartDatum, ChartProps, DrawerProps, NavigationMenuLink, NavigationMenuItem, NavigationMenuProps, ResizableProps, SidebarItem, SidebarProps, QuestionnaireAnswer, QuestionnaireQuestion, QuestionnaireProps } from "./advanced-controls";
|
|
22
|
+
export { Attachment, Bubble, Marker, Message, MessageScroller } from "./chat-controls";
|
|
23
|
+
export type { AttachmentStatus, AttachmentProps, BubbleSide, BubbleVariant, BubbleProps, MarkerProps, MessageProps, MessageScrollerProps } from "./chat-controls";
|
|
24
|
+
export { TreeView, DataGrid } from "./desktop-controls";
|
|
25
|
+
export type { TreeNode, TreeViewProps, DataGridKey, DataGridSortDirection, DataGridSort, DataGridColumn, DataGridProps } from "./desktop-controls";
|
|
20
26
|
export { normalizeHotkey } from "./hotkeys";
|
|
21
27
|
export { createTextSearchController, findRanges } from "./text-search";
|
|
22
28
|
export type { FindRangesOptions, TextSearchOptions, TextSearchController, TextSearchSnapshot } from "./text-search";
|
|
23
29
|
export type { HotkeyHandler } from "./hotkeys";
|
|
24
30
|
export { createApp, render } from "./app";
|
|
25
|
-
export
|
|
31
|
+
export { checkForUpdate, downloadUpdate, installUpdate, canInstallUpdate, cleanupUpdate, compareVersions, verifyUpdateManifest, validateUpdateManifest, isValidVersion, assertUpdateUrl, updatePlatform } from "./updates";
|
|
32
|
+
export type { Update, UpdateArtifact, UpdateManifest, SignedUpdateManifest, CheckForUpdateOptions, DownloadUpdateOptions, InstallUpdateOptions } from "./updates";
|
|
33
|
+
export type { AppErrorEvent, AppErrorSource, AppHandle, AppJsStats, AppOptions, AppStats, NotifyOptions, SystemMediaSession, TrayHandle, TrayMenuItem, TrayOptions } from "./app";
|
|
26
34
|
export { TestRenderer, Locator, createTestRenderer, launchTestProcess, waitFor } from "./test-renderer";
|
|
27
35
|
export type { Point, RoleLocatorOptions, TestProcess, TestProcessOptions, TestRendererOptions, TextLocatorOptions, WaitForOptions, WheelOptions } from "./test-renderer";
|
|
28
36
|
export { assertPngMatches, comparePngCaptures, compareRgbaImages, readPngRgba } from "./visual-testing";
|
|
@@ -31,9 +39,10 @@ export type { ComponentAdapter, ComponentAdapterInput } from "./component-adapte
|
|
|
31
39
|
export { theme, Theme, lightTheme, darkTheme, createTheme, buttonVariants } from "./theme";
|
|
32
40
|
export type { ThemeColors, ThemeFocusOutline, ThemeDefinition, ThemeOverrides, ButtonVariant } from "./theme";
|
|
33
41
|
export { Style } from "./style";
|
|
34
|
-
export type { StateStyle, OutlineStyle, BorderStyle, TextShadow, BoxShadow, Transform, Gradient, GradientStop, GradientSide, GradientLength, GradientCentre, RadialExtent, LinearGradient, RadialGradient, ConicGradient, ConicGradientStop, UserSelect, TextDecoration, Renderer, WindowPosition, WindowPositionPreset, FileDialogFilter, FileDialogOptions, ScrollOrientation, ScrollPosition, MotionProperty, NumericMotionProperty, MotionEasing, MotionTransition, MotionTransitions, MotionValues } from "
|
|
42
|
+
export type { StateStyle, OutlineStyle, BorderStyle, TextShadow, BoxShadow, Transform, Gradient, GradientStop, GradientSide, GradientLength, GradientCentre, RadialExtent, LinearGradient, RadialGradient, ConicGradient, ConicGradientStop, UserSelect, TextDecoration, GlassMaterial, Renderer, WindowPosition, WindowPositionPreset, WindowLevel, DesktopWidget, FileDialogFilter, FileDialogOptions, ScrollOrientation, ScrollPosition, ScrollSource, ScrollInfo, MotionProperty, NumericMotionProperty, MotionEasing, MotionTransition, MotionTransitions, MotionValues, MemoryReading, NativeStats, PhaseSummary } from "./protocol";
|
|
35
43
|
export type { VNode, Child, PastePayload, DragPosition, DragMoveEvent, DragEndEvent, DropEvent, DraggableProps, DropTargetProps } from "./jsx-runtime";
|
|
36
44
|
export { BunFfiBridge, openExternal } from "./bridge";
|
|
37
45
|
export type { NativeBridge, BunFfiBridgeOptions } from "./bridge";
|
|
38
46
|
export { CanvasRenderingContext2D, CanvasGradient, parseCanvasFont } from "./canvas";
|
|
39
47
|
export type { MediaController, MediaElementProps, MediaEventInfo } from "./media-element";
|
|
48
|
+
export { tw } from "./tailwind";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextRun } from "
|
|
1
|
+
import type { TextRun } from "./protocol";
|
|
2
2
|
import { type Child } from "./jsx-runtime";
|
|
3
3
|
export declare const INLINE_TAG_NAMES: Set<string>;
|
|
4
4
|
type RunStyle = Record<string, unknown>;
|
|
@@ -13,8 +13,12 @@ export interface InlineContext {
|
|
|
13
13
|
openExternal(href: string): void;
|
|
14
14
|
}
|
|
15
15
|
export declare function hasInlineElements(children: Child): boolean;
|
|
16
|
-
/**
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Flattens inline children into text plus runs, applying CSS white-space.
|
|
18
|
+
* `base` is the text node's computed style; `context` is built only when the
|
|
19
|
+
* children hold phrasing elements.
|
|
20
|
+
*/
|
|
21
|
+
export declare function compileInline(children: Child, whiteSpace: string, base: RunStyle, context: () => InlineContext): {
|
|
18
22
|
text: string;
|
|
19
23
|
runs: TextRun[];
|
|
20
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Control, MotionProperty, MotionValues, StateStyle, Style, SvgNode, TextHighlight } from "
|
|
1
|
+
import type { Control, MotionProperty, MotionValues, StateStyle, Style, SvgNode, TextHighlight } from "./protocol";
|
|
2
2
|
import type { ImageSource } from "./components/image";
|
|
3
3
|
export type Child = VNode | string | number | boolean | null | undefined | Child[];
|
|
4
4
|
/** Clipboard content delivered to the focused element when the clipboard holds no text. */
|
|
@@ -48,6 +48,10 @@ export interface BaseProps {
|
|
|
48
48
|
key?: string | number;
|
|
49
49
|
children?: Child;
|
|
50
50
|
style?: Style;
|
|
51
|
+
/** Tailwind utility classes, compiled to `style` at the call site; an explicit `style` wins. */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Same as `className`, HTML spelling. Both may be given; `className` comes last. */
|
|
54
|
+
class?: string;
|
|
51
55
|
rovingGroup?: boolean;
|
|
52
56
|
highlight?: TextHighlight;
|
|
53
57
|
onHighlight?: (event: {
|
|
@@ -77,7 +81,9 @@ export type IntrinsicStateStyle = StateStyle & {
|
|
|
77
81
|
backgroundColor?: string;
|
|
78
82
|
color?: string;
|
|
79
83
|
};
|
|
80
|
-
export type IntrinsicStyle = Omit<Style, "hover" | "focus" | "focusVisible" | "active" | "disabled" | "overflow"> & {
|
|
84
|
+
export type IntrinsicStyle = Omit<Style, "hover" | "focus" | "focusVisible" | "active" | "disabled" | "overflow" | "dark"> & {
|
|
85
|
+
/** Overrides under a dark window theme (Tailwind's `dark:`). */
|
|
86
|
+
dark?: Omit<IntrinsicStyle, "dark">;
|
|
81
87
|
/** CSS `overflow`; on a `<div>`, `auto` or `scroll` makes it a scroll container. */
|
|
82
88
|
overflow?: Style["overflow"] | "auto" | "scroll";
|
|
83
89
|
overflowX?: Style["overflow"] | "auto" | "scroll";
|
|
@@ -89,10 +95,10 @@ export type IntrinsicStyle = Omit<Style, "hover" | "focus" | "focusVisible" | "a
|
|
|
89
95
|
/** CSS-like alias for Tarve's native `foreground`. */
|
|
90
96
|
color?: string;
|
|
91
97
|
/** CSS-like alias for Tarve's native `radius`. */
|
|
92
|
-
borderRadius?:
|
|
98
|
+
borderRadius?: Style["radius"];
|
|
93
99
|
/** CSS `align-items` and `justify-content` (Tarve's `align` and `justify`). */
|
|
94
100
|
alignItems?: "flex-start" | "start" | "center" | "flex-end" | "end" | "stretch";
|
|
95
|
-
justifyContent?: "flex-start" | "start" | "center" | "flex-end" | "end" | "space-between";
|
|
101
|
+
justifyContent?: "flex-start" | "start" | "center" | "flex-end" | "end" | "space-between" | "space-around" | "space-evenly";
|
|
96
102
|
/** CSS `object-fit` on an `<img>` (its `fit` prop). */
|
|
97
103
|
objectFit?: "fill" | "contain" | "cover" | "none" | "scale-down";
|
|
98
104
|
hover?: IntrinsicStateStyle;
|
|
@@ -45,9 +45,8 @@ interface MediaState {
|
|
|
45
45
|
ended: boolean;
|
|
46
46
|
error?: string;
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
export declare function
|
|
50
|
-
export declare function mediaState(id: string): MediaState;
|
|
48
|
+
/** Playback state of an element; during render the current scope, otherwise the app's `scope`. */
|
|
49
|
+
export declare function mediaState(id: string, scope?: object): MediaState;
|
|
51
50
|
export interface MediaController {
|
|
52
51
|
play(): void;
|
|
53
52
|
pause(): void;
|
|
@@ -67,5 +66,5 @@ export declare function applyMediaEvent(event: {
|
|
|
67
66
|
duration?: number | null;
|
|
68
67
|
paused?: boolean;
|
|
69
68
|
message?: string;
|
|
70
|
-
}, request: MediaRequest | undefined): (() => void) | undefined;
|
|
69
|
+
}, request: MediaRequest | undefined, scope: object): (() => void) | undefined;
|
|
71
70
|
export {};
|
|
@@ -4,6 +4,8 @@ export declare const MEMO: unique symbol;
|
|
|
4
4
|
export interface MemoInfo<P> {
|
|
5
5
|
render: (props: P) => VNode;
|
|
6
6
|
equal: (previous: P, next: P) => boolean;
|
|
7
|
+
/** A compiled JSX template (jsx-compile.ts): it renders one element, which keeps its list position. */
|
|
8
|
+
template?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** Object.is on every own prop, like React.memo's default comparison. */
|
|
9
11
|
export declare function shallowEqual(previous: object, next: object): boolean;
|
|
@@ -16,3 +18,11 @@ export declare function shallowEqual(previous: object, next: object): boolean;
|
|
|
16
18
|
* from its props; reading module state inside it shows stale values.
|
|
17
19
|
*/
|
|
18
20
|
export declare function memo<P extends object>(render: (props: P) => VNode, equal?: (previous: P, next: P) => boolean): (props: P) => VNode;
|
|
21
|
+
/**
|
|
22
|
+
* A JSX subtree compiled at build time (packages/core/jsx-compile.ts): `render` builds
|
|
23
|
+
* the subtree from its dynamic parts (`props`), which are only values the parent
|
|
24
|
+
* computed, so the compiled subtree is reused while they are equal. Event handler
|
|
25
|
+
* props (`events`) never force a recompile: the subtree calls whichever handler the
|
|
26
|
+
* latest render passed.
|
|
27
|
+
*/
|
|
28
|
+
export declare function template<P extends Record<string, unknown>>(render: (props: P) => VNode, events?: readonly string[]): (props: P) => VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MotionTransitions, MotionValues } from "
|
|
1
|
+
import type { MotionTransitions, MotionValues } from "./protocol";
|
|
2
2
|
import { type VNode } from "./jsx-runtime";
|
|
3
3
|
export interface AnimatePresenceProps {
|
|
4
4
|
/** Stable identity for this presence boundary. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Style } from "
|
|
1
|
+
import type { Style } from "./protocol";
|
|
2
2
|
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
3
3
|
import { type IconName } from "./components";
|
|
4
4
|
export type PopupSide = "top" | "right" | "bottom" | "left";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wire protocol shared with the native runtime. Imported by path, not as
|
|
3
|
+
* `@tarve/protocol`: the published `dist/types` keep this relative import so
|
|
4
|
+
* consumers resolve the bundled `protocol/src/index.d.ts` without a second package.
|
|
5
|
+
*/
|
|
6
|
+
export * from "../../protocol/src/index";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NativeNode, TreeMutation } from "../protocol";
|
|
2
|
+
import type { CompiledTree } from "../reconciler";
|
|
3
|
+
/** Structural equality of plain data (styles, controls, memo props). */
|
|
4
|
+
export declare function sameValue(a: unknown, b: unknown): boolean;
|
|
5
|
+
/** null requests a structural replacement; an empty list means no native work is needed. */
|
|
6
|
+
export declare function diffTrees(previous: CompiledTree, next: CompiledTree): NativeNode[] | null;
|
|
7
|
+
/**
|
|
8
|
+
* Computes one atomic retained-tree mutation batch. A null result is reserved for
|
|
9
|
+
* identity-incompatible replacements (root ID or an existing keyed node kind changed).
|
|
10
|
+
*/
|
|
11
|
+
export declare function diffTreeMutations(previous: CompiledTree, next: CompiledTree, unchanged?: (old: NativeNode, node: NativeNode) => boolean): TreeMutation[] | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Child, type VNode } from "../jsx-runtime";
|
|
2
|
+
import { type MediaRequest } from "../media-element";
|
|
3
|
+
import { type FormContext } from "../html-elements";
|
|
4
|
+
/** Layout props a `<div>` accepts directly, as shorthands for its style. */
|
|
5
|
+
export declare const DIV_SHORTHANDS: readonly ["gap", "padding", "flex", "align", "justify"];
|
|
6
|
+
export declare function textContent(value: Child): string;
|
|
7
|
+
/** What the reconciler lends an intrinsic element while it compiles. */
|
|
8
|
+
export interface IntrinsicContext {
|
|
9
|
+
/** The enclosing `<form>`, if any. */
|
|
10
|
+
form: FormContext | undefined;
|
|
11
|
+
/** Names the native node a `<label htmlFor>` targets for `id`. */
|
|
12
|
+
labelable(id: string, nativeId: string): void;
|
|
13
|
+
/** Ties a `<label>` to its `htmlFor` target. */
|
|
14
|
+
label(targetId: string, labelId: string): void;
|
|
15
|
+
/** Declares an `<audio>` element's native media. */
|
|
16
|
+
media(id: string, request: MediaRequest): void;
|
|
17
|
+
}
|
|
18
|
+
export interface IntrinsicExpansion {
|
|
19
|
+
element: VNode;
|
|
20
|
+
/** A `<form>`: the element's descendants compile inside this form. */
|
|
21
|
+
form?: FormContext;
|
|
22
|
+
}
|
|
23
|
+
/** The component element an intrinsic `child` compiles as; undefined when `child` is a native kind. */
|
|
24
|
+
export declare function expandIntrinsic(child: VNode, path: string, context: IntrinsicContext): IntrinsicExpansion | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type MotionProperty, type NativeNode, type Renderer, type SceneDocument, type
|
|
1
|
+
import { type MotionProperty, type NativeNode, type Renderer, type SceneDocument, type ScrollInfo, type ScrollPosition, type VirtualListMeasurement } from "./protocol";
|
|
2
2
|
import { type DragEndEvent, type DragMoveEvent, type DragPosition, type DropEvent, type PastePayload, type VNode } from "./jsx-runtime";
|
|
3
3
|
import type { WindowCloseRequestEvent } from "./components";
|
|
4
4
|
import type { ComponentAdapter } from "./component-adapter";
|
|
5
|
-
import {
|
|
5
|
+
import type { MediaRequest } from "./media-element";
|
|
6
|
+
export { diffTrees, diffTreeMutations } from "./reconciler/diff";
|
|
6
7
|
export interface Handlers {
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
onMarkdownLink?: (href: string) => void;
|
|
@@ -27,7 +28,7 @@ export interface Handlers {
|
|
|
27
28
|
onSubmit?: (value: string) => void;
|
|
28
29
|
onPaste?: (payload: PastePayload) => void;
|
|
29
30
|
onValueChange?: (value: number) => void;
|
|
30
|
-
onScroll?: (offset: number, max: number) => void;
|
|
31
|
+
onScroll?: (offset: number, max: number, info: ScrollInfo) => void;
|
|
31
32
|
onScrollPosition?: (position: ScrollPosition) => void;
|
|
32
33
|
onVirtualListLayout?: (items: VirtualListMeasurement[]) => void;
|
|
33
34
|
onVirtualListScrollToItem?: (index: number, offset: number, smooth?: boolean) => void;
|
|
@@ -60,6 +61,8 @@ export interface CompiledTree {
|
|
|
60
61
|
handlers: Map<string, Handlers>;
|
|
61
62
|
nodes: Map<string, NativeNode>;
|
|
62
63
|
media?: Map<string, MediaRequest>;
|
|
64
|
+
/** Some style carried a window-width breakpoint: the app re-renders when the width changes. */
|
|
65
|
+
usesViewport?: boolean;
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
65
68
|
* Forgets every memoized subtree containing `id`, so the next render compiles it
|
|
@@ -68,11 +71,7 @@ export interface CompiledTree {
|
|
|
68
71
|
* which its props alone do not show.
|
|
69
72
|
*/
|
|
70
73
|
export declare function invalidateMemos(renderScope: object, id: string): void;
|
|
71
|
-
export declare function compileTree(element: VNode, debug?: boolean, renderer?: Renderer, componentAdapters?: readonly ComponentAdapter[], renderScope?: object, visible?: boolean
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* Computes one atomic retained-tree mutation batch. A null result is reserved for
|
|
76
|
-
* identity-incompatible replacements (root ID or an existing keyed node kind changed).
|
|
77
|
-
*/
|
|
78
|
-
export declare function diffTreeMutations(previous: CompiledTree, next: CompiledTree, unchanged?: (old: NativeNode, node: NativeNode) => boolean): TreeMutation[] | null;
|
|
74
|
+
export declare function compileTree(element: VNode, debug?: boolean, renderer?: Renderer, componentAdapters?: readonly ComponentAdapter[], renderScope?: object, visible?: boolean, viewport?: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
}): CompiledTree;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export declare function currentRenderScope(): object;
|
|
2
2
|
export declare function currentRenderEpoch(): number;
|
|
3
3
|
export declare function withRenderScope<T>(scope: object | undefined, render: () => T): T;
|
|
4
|
+
/**
|
|
5
|
+
* Module state kept per render scope (one app, one remount, one test renderer),
|
|
6
|
+
* like a DOM document keeps its elements' state. Read during render; event
|
|
7
|
+
* handlers close over the value they received at render time.
|
|
8
|
+
*/
|
|
9
|
+
export declare function scopedState<T>(key: symbol, create: () => T, scope?: object): T;
|
|
10
|
+
/** Forgets every scoped state of a scope (tests). */
|
|
11
|
+
export declare function resetScopedState(scope?: object): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Style as ProtocolStyle } from "
|
|
1
|
+
import type { Style as ProtocolStyle } from "./protocol";
|
|
2
2
|
export type Style = ProtocolStyle;
|
|
3
3
|
/** Typed style helpers. `create` is allocation-free; `merge` deep-merges visual state objects. */
|
|
4
4
|
export declare const Style: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PALETTE: Record<string, string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Style } from "./protocol";
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind utility classes as a Tarve style. Falsy arguments are skipped, so it
|
|
4
|
+
* composes like `clsx`: `tw("p-4", active && "bg-primary")`. Later classes win.
|
|
5
|
+
*/
|
|
6
|
+
export declare function tw(...classes: readonly (string | false | null | undefined)[]): Style;
|
|
7
|
+
/** `className` compiled under an explicit `style`: inline wins, as it does in CSS. */
|
|
8
|
+
export declare function styleWithClassName(className: string, style: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Control, NodeSnapshot, Renderer, Snapshot } from "
|
|
1
|
+
import type { Control, NodeSnapshot, Renderer, Snapshot } from "./protocol";
|
|
2
2
|
import { type AppHandle, type AppOptions } from "./app";
|
|
3
3
|
import type { VNode } from "./jsx-runtime";
|
|
4
4
|
export interface WaitForOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StateStyle, Style, SyntaxTheme } from "
|
|
1
|
+
import type { StateStyle, Style, SyntaxTheme } from "./protocol";
|
|
2
2
|
export interface ThemeColors {
|
|
3
3
|
background: string;
|
|
4
4
|
card: string;
|
|
@@ -89,6 +89,13 @@ export declare const theme: {
|
|
|
89
89
|
};
|
|
90
90
|
export declare function resolveThemeColor(value: string, selected: ThemeDefinition): string;
|
|
91
91
|
export declare function resolveStyleString(key: string, value: string, selected: ThemeDefinition): string;
|
|
92
|
+
/**
|
|
93
|
+
* Theme-resolved copy of a style. Equal styles (most nodes of a list share a handful)
|
|
94
|
+
* resolve once per theme: the result is cached by the style's JSON, which QuickJS
|
|
95
|
+
* serializes in C far faster than the resolution runs in JS. Nested objects (state
|
|
96
|
+
* styles, shadows, gradients) are the cache's own copies, shared and frozen; the top
|
|
97
|
+
* level is a fresh copy callers may extend.
|
|
98
|
+
*/
|
|
92
99
|
export declare function resolveThemeStyle(style: Style, selected: ThemeDefinition): Style;
|
|
93
100
|
export type ButtonVariant = "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
94
101
|
export declare const buttonVariants: Record<ButtonVariant, Style>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** One downloadable build of a release, keyed by `<platform>-<arch>` (e.g. `win32-x64`). */
|
|
2
|
+
export interface UpdateArtifact {
|
|
3
|
+
url: string;
|
|
4
|
+
sha256: string;
|
|
5
|
+
size: number;
|
|
6
|
+
}
|
|
7
|
+
/** What `tarve release` signs: the release and one artifact per platform. */
|
|
8
|
+
export interface UpdateManifest {
|
|
9
|
+
name?: string;
|
|
10
|
+
version: string;
|
|
11
|
+
notes?: string;
|
|
12
|
+
pubDate: string;
|
|
13
|
+
platforms: Record<string, UpdateArtifact>;
|
|
14
|
+
}
|
|
15
|
+
/** The file served at the update URL: the manifest as signed text plus its Ed25519 signature (base64). */
|
|
16
|
+
export interface SignedUpdateManifest {
|
|
17
|
+
payload: string;
|
|
18
|
+
signature: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Update extends UpdateArtifact {
|
|
21
|
+
version: string;
|
|
22
|
+
currentVersion: string;
|
|
23
|
+
notes?: string;
|
|
24
|
+
pubDate: string;
|
|
25
|
+
platform: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CheckForUpdateOptions {
|
|
28
|
+
/** URL of the signed manifest (`latest.json`). HTTPS, or HTTP on localhost. */
|
|
29
|
+
url: string;
|
|
30
|
+
/** Ed25519 public key from `tarve keygen` (base64, 32 bytes). */
|
|
31
|
+
publicKey: string;
|
|
32
|
+
/** Defaults to the version baked in by `tarve build`. */
|
|
33
|
+
currentVersion?: string;
|
|
34
|
+
/** Defaults to `${process.platform}-${process.arch}`. */
|
|
35
|
+
platform?: string;
|
|
36
|
+
/** Reject a manifest released under another name; defaults to the app name baked in by `tarve build`. */
|
|
37
|
+
name?: string;
|
|
38
|
+
/** Accept plain HTTP from hosts other than localhost (the manifest is still signed). */
|
|
39
|
+
allowInsecure?: boolean;
|
|
40
|
+
fetch?: typeof fetch;
|
|
41
|
+
signal?: AbortSignal;
|
|
42
|
+
}
|
|
43
|
+
export interface DownloadUpdateOptions {
|
|
44
|
+
onProgress?: (received: number, total: number) => void;
|
|
45
|
+
/** Where to write the download; defaults to next to the executable, so install is a rename. */
|
|
46
|
+
path?: string;
|
|
47
|
+
allowInsecure?: boolean;
|
|
48
|
+
fetch?: typeof fetch;
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}
|
|
51
|
+
export interface InstallUpdateOptions {
|
|
52
|
+
/** Executable to replace; defaults to `process.execPath`. */
|
|
53
|
+
executable?: string;
|
|
54
|
+
/** Start the new version and exit this process (default true). */
|
|
55
|
+
restart?: boolean;
|
|
56
|
+
args?: string[];
|
|
57
|
+
}
|
|
58
|
+
export declare function updatePlatform(): string;
|
|
59
|
+
/** `1.2.3`, `v1.2`, `1.0.0-beta.1+build.5`. */
|
|
60
|
+
export declare function isValidVersion(version: string): boolean;
|
|
61
|
+
/** `win32-x64` style: the OS (as in `process.platform`) and the architecture. */
|
|
62
|
+
export declare function isValidPlatform(platform: string): boolean;
|
|
63
|
+
/** Throws unless `url` is HTTPS, or HTTP on localhost (or `allowInsecure`). */
|
|
64
|
+
export declare function assertUpdateUrl(url: string, allowInsecure?: boolean): URL;
|
|
65
|
+
/** Checks the shape of a parsed manifest; throws a TypeError naming the bad field. */
|
|
66
|
+
export declare function validateUpdateManifest(value: unknown): UpdateManifest;
|
|
67
|
+
/** Verifies `signed` against `publicKey` and returns the manifest; throws on a bad signature or shape. */
|
|
68
|
+
export declare function verifyUpdateManifest(signed: SignedUpdateManifest, publicKey: string): UpdateManifest;
|
|
69
|
+
/** Semver-ish comparison: numeric core, a pre-release sorts before its release. */
|
|
70
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
71
|
+
/** Fetches and verifies the manifest; resolves the newer release for this platform, or null. */
|
|
72
|
+
export declare function checkForUpdate(options: CheckForUpdateOptions): Promise<Update | null>;
|
|
73
|
+
/** Bytes every executable for `platform` starts with; undefined when Tarve does not know the format. */
|
|
74
|
+
export declare function executableMagic(platform: string): Uint8Array | undefined;
|
|
75
|
+
/** Whether `bytes` (the start of a file) looks like an executable for `platform`. */
|
|
76
|
+
export declare function looksExecutable(bytes: Uint8Array, platform: string): boolean;
|
|
77
|
+
/** Downloads the update, checking its size, SHA-256 and executable format; resolves the file path. */
|
|
78
|
+
export declare function downloadUpdate(update: Update, options?: DownloadUpdateOptions): Promise<string>;
|
|
79
|
+
/** Whether this process can replace its own executable (a built app in a writable folder). */
|
|
80
|
+
export declare function canInstallUpdate(executable?: string): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Swaps the executable for `file` (Windows keeps the running one as `<exe>.old`,
|
|
83
|
+
* removed on the next check) and, by default, starts the new version and exits.
|
|
84
|
+
*/
|
|
85
|
+
export declare function installUpdate(file: string, options?: InstallUpdateOptions): void;
|
|
86
|
+
/** Removes what a finished update left behind (`<exe>.old`). Safe to call at any time. */
|
|
87
|
+
export declare function cleanupUpdate(executable?: string): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
2
|
+
import type { ScrollInfo } from "./protocol";
|
|
2
3
|
export interface VirtualListProps<T> extends BaseProps {
|
|
3
4
|
items: readonly T[];
|
|
4
5
|
itemHeight: number;
|
|
@@ -11,7 +12,8 @@ export interface VirtualListProps<T> extends BaseProps {
|
|
|
11
12
|
overscan?: number;
|
|
12
13
|
keyForItem?: (item: T, index: number) => string | number;
|
|
13
14
|
renderItem: (item: T, index: number) => Child;
|
|
14
|
-
|
|
15
|
+
/** `info.source` tells the user's scrolling from a scrollToItem (and its smooth steps). */
|
|
16
|
+
onScroll: (offset: number, max: number, info: ScrollInfo) => void;
|
|
15
17
|
}
|
|
16
18
|
export interface VariableVirtualListProps<T> extends Omit<VirtualListProps<T>, "itemHeight" | "keyForItem"> {
|
|
17
19
|
/** Stable list id is required so measured heights survive rerenders. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createFetch(fallback: typeof fetch): typeof fetch;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** [group, decimal, minimum grouping digits, secondary group size, percent pattern, minus sign, date formats per DATE_OPTIONS]. */
|
|
2
|
+
export type LocaleData = [string, string, number, number, string, string, number[][]];
|
|
3
|
+
export declare const DATE_KEYS: string[];
|
|
4
|
+
export declare const TEMPLATES: string[];
|
|
5
|
+
export declare const NAMES: string[][];
|
|
6
|
+
export declare const LOCALES: Record<string, LocaleData>;
|