@felipe-software/react-native-gpui 0.0.0-stage → 1.0.1
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/.reanimated-prebuilt/react-native-reanimated.mjs +29373 -0
- package/LICENSE +21 -0
- package/README.md +657 -2
- package/cli/bin.ts +379 -0
- package/cli/bundle.ts +32 -0
- package/cli/commands/do.ts +213 -0
- package/cli/commands/flow.ts +283 -0
- package/cli/commands/get.ts +584 -0
- package/cli/commands/shot.ts +312 -0
- package/cli/commands/trace.ts +293 -0
- package/cli/host.ts +714 -0
- package/cli/hotReload.ts +210 -0
- package/cli/run.ts +66 -0
- package/cli/selectors.ts +205 -0
- package/dist/Animated.d.ts +120 -0
- package/dist/ChatList.d.ts +28 -0
- package/dist/Dimensions.d.ts +31 -0
- package/dist/StyleSheet.d.ts +18 -0
- package/dist/Window.d.ts +33 -0
- package/dist/apis.d.ts +165 -0
- package/dist/app-state.d.ts +27 -0
- package/dist/chat-list-types.d.ts +136 -0
- package/dist/colors.d.ts +32 -0
- package/dist/commands.d.ts +230 -0
- package/dist/components.d.ts +419 -0
- package/dist/hotModules.d.ts +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.development.js +14876 -0
- package/dist/index.js +12 -0
- package/dist/keyboard.d.ts +140 -0
- package/dist/native-menu.d.ts +7 -0
- package/dist/platform-driver.d.ts +32 -0
- package/dist/platform-services.d.ts +35 -0
- package/dist/portal.d.ts +43 -0
- package/dist/raf.d.ts +4 -0
- package/dist/reanimated/colors-processor-shim.d.ts +10 -0
- package/dist/reanimated/reanimated-host.d.ts +10 -0
- package/dist/reanimated/seam.d.ts +34 -0
- package/dist/reanimated/ui-entry.d.ts +2 -0
- package/dist/reanimated/worklet-channel.d.ts +10 -0
- package/dist/reanimated/worklet-runtime.d.ts +466 -0
- package/dist/reanimated/worklets.d.ts +199 -0
- package/dist/reconciler.d.ts +102 -0
- package/dist/refresh.d.ts +1 -0
- package/dist/render.d.ts +37 -0
- package/dist/runtime.d.ts +235 -0
- package/dist/surfaces.d.ts +51 -0
- package/dist/types.d.ts +276 -0
- package/dist/ui-runtime.js +42276 -0
- package/dist/window-context.d.ts +7 -0
- package/dist/window-host.d.ts +41 -0
- package/dist/wire-delta.d.ts +20 -0
- package/package.json +176 -5
- package/scripts/bundle-app.mjs +88 -0
- package/scripts/conformance-utils.mjs +293 -0
- package/scripts/hot-update-alias-plugin.mjs +88 -0
- package/scripts/native-package-exports-plugin.mjs +235 -0
- package/scripts/pixel.mjs +152 -0
- package/scripts/png.mjs +198 -0
- package/scripts/react-refresh-swc.mjs +35 -0
- package/scripts/reanimated-bun-plugin.mjs +188 -0
- package/scripts/service-binary.d.mts +27 -0
- package/scripts/service-binary.mjs +100 -0
- package/src/reanimated/colors-processor-shim.ts +119 -0
- package/src/reanimated/reanimated-host.ts +69 -0
- package/src/reanimated/rngpui-reanimated-prebuilt.d.ts +7 -0
- package/src/reanimated/seam.ts +566 -0
- package/src/reanimated/ui-entry.ts +80 -0
- package/src/reanimated/worklet-channel.ts +64 -0
- package/src/reanimated/worklet-runtime.ts +2569 -0
- package/src/reanimated/worklets.ts +1334 -0
- package/src/refresh.ts +33 -0
package/dist/Window.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type WindowCloseReason, type WindowKind, type WindowPosition } from "./window-host";
|
|
3
|
+
export type WindowCloseEvent = {
|
|
4
|
+
reason: WindowCloseReason;
|
|
5
|
+
};
|
|
6
|
+
export interface WindowProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
position?: WindowPosition;
|
|
13
|
+
kind?: WindowKind;
|
|
14
|
+
resizable?: boolean;
|
|
15
|
+
alwaysOnTop?: boolean;
|
|
16
|
+
closeOnBlur?: boolean;
|
|
17
|
+
closeOnEscape?: boolean;
|
|
18
|
+
testID?: string;
|
|
19
|
+
onClose?: (event: WindowCloseEvent) => void;
|
|
20
|
+
onFocus?: () => void;
|
|
21
|
+
onBlur?: () => void;
|
|
22
|
+
onResize?: (size: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}) => void;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export interface WindowHandle {
|
|
29
|
+
readonly windowId: number;
|
|
30
|
+
focus(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const Window: import("react").ForwardRefExoticComponent<WindowProps & import("react").RefAttributes<WindowHandle>>;
|
|
33
|
+
export type { WindowCloseReason, WindowKind, WindowPosition } from "./window-host";
|
package/dist/apis.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { type ScaledSize } from "./Dimensions";
|
|
2
|
+
export { Appearance, DynamicColorIOS, PlatformColor, processColor, resolveColorValue, useColorScheme, type ColorSchemeName, type DynamicColorIOSTuple, } from "./colors";
|
|
3
|
+
export declare function useWindowDimensions(): ScaledSize;
|
|
4
|
+
type PlatformOSType = "ios" | "android" | "macos" | "linux" | "windows" | "web";
|
|
5
|
+
export declare const Platform: {
|
|
6
|
+
OS: PlatformOSType;
|
|
7
|
+
Version: number | string;
|
|
8
|
+
isPad: boolean;
|
|
9
|
+
isTV: boolean;
|
|
10
|
+
isTesting: boolean;
|
|
11
|
+
constants: {};
|
|
12
|
+
select<T>(spec: { [k in PlatformOSType | "native" | "default"]?: T; }): T | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare const PixelRatio: {
|
|
15
|
+
get(): number;
|
|
16
|
+
getFontScale(): number;
|
|
17
|
+
getPixelSizeForLayoutSize(layoutSize: number): number;
|
|
18
|
+
roundToNearestPixel(layoutSize: number): number;
|
|
19
|
+
};
|
|
20
|
+
/** RN's I18nManager. LTR on desktop. */
|
|
21
|
+
export declare const I18nManager: {
|
|
22
|
+
isRTL: boolean;
|
|
23
|
+
doLeftAndRightSwapInRTL: boolean;
|
|
24
|
+
allowRTL(_: boolean): void;
|
|
25
|
+
forceRTL(_: boolean): void;
|
|
26
|
+
swapLeftAndRightInRTL(_: boolean): void;
|
|
27
|
+
};
|
|
28
|
+
type AlertButton = {
|
|
29
|
+
text?: string;
|
|
30
|
+
onPress?: () => void;
|
|
31
|
+
style?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const Alert: {
|
|
34
|
+
alert(title: string, message?: string, buttons?: AlertButton[]): void;
|
|
35
|
+
prompt(title: string, message?: string): void;
|
|
36
|
+
};
|
|
37
|
+
type Sub = {
|
|
38
|
+
remove(): void;
|
|
39
|
+
};
|
|
40
|
+
export declare const Keyboard: {
|
|
41
|
+
addListener: () => Sub;
|
|
42
|
+
removeAllListeners(_event?: string): void;
|
|
43
|
+
dismiss(): void;
|
|
44
|
+
isVisible(): boolean;
|
|
45
|
+
scheduleLayoutAnimation(): void;
|
|
46
|
+
};
|
|
47
|
+
export declare const BackHandler: {
|
|
48
|
+
addEventListener: () => Sub;
|
|
49
|
+
removeEventListener(_handler: () => boolean): void;
|
|
50
|
+
exitApp(): void;
|
|
51
|
+
};
|
|
52
|
+
export { AppState, useAppState, useWindowFocused, type AppStateStatus, type AppStateEventType, type WindowFocusEvent } from "./app-state";
|
|
53
|
+
export declare const Linking: {
|
|
54
|
+
addEventListener: () => Sub;
|
|
55
|
+
canOpenURL(url: string): Promise<boolean>;
|
|
56
|
+
openURL(url: string): Promise<void>;
|
|
57
|
+
getInitialURL(): Promise<string | null>;
|
|
58
|
+
};
|
|
59
|
+
export declare const InteractionManager: {
|
|
60
|
+
runAfterInteractions(task?: () => void): {
|
|
61
|
+
then: (cb: () => void) => void;
|
|
62
|
+
done: () => void;
|
|
63
|
+
cancel: () => void;
|
|
64
|
+
};
|
|
65
|
+
createInteractionHandle(): number;
|
|
66
|
+
clearInteractionHandle(_handle: number): void;
|
|
67
|
+
setDeadline(_deadline: number): void;
|
|
68
|
+
};
|
|
69
|
+
export declare const LayoutAnimation: {
|
|
70
|
+
configureNext(_config: unknown, onAnimationDidEnd?: () => void): void;
|
|
71
|
+
create(_duration: number, _type?: unknown, _creationProp?: unknown): unknown;
|
|
72
|
+
Types: Record<string, string>;
|
|
73
|
+
Properties: Record<string, string>;
|
|
74
|
+
Presets: {
|
|
75
|
+
easeInEaseOut: {};
|
|
76
|
+
linear: {};
|
|
77
|
+
spring: {};
|
|
78
|
+
};
|
|
79
|
+
easeInEaseOut(): void;
|
|
80
|
+
linear(): void;
|
|
81
|
+
spring(): void;
|
|
82
|
+
};
|
|
83
|
+
export declare const UIManager: {
|
|
84
|
+
measure(node: unknown, callback: (x: number, y: number, w: number, h: number, px: number, py: number) => void): void;
|
|
85
|
+
measureInWindow(node: unknown, callback: (x: number, y: number, w: number, h: number) => void): void;
|
|
86
|
+
measureLayout(node: unknown, relativeToNativeNode: unknown, onFail: () => void, onSuccess: (left: number, top: number, width: number, height: number) => void): void;
|
|
87
|
+
getViewManagerConfig(_name: string): unknown;
|
|
88
|
+
hasViewManagerConfig(_name: string): boolean;
|
|
89
|
+
setLayoutAnimationEnabledExperimental(_enabled: boolean): void;
|
|
90
|
+
};
|
|
91
|
+
export declare const NativeModules: Record<string, unknown>;
|
|
92
|
+
export type FilePickerOptions = {
|
|
93
|
+
multiple?: boolean;
|
|
94
|
+
files?: boolean;
|
|
95
|
+
directories?: boolean;
|
|
96
|
+
prompt?: string;
|
|
97
|
+
};
|
|
98
|
+
declare global {
|
|
99
|
+
var __rngpui_pickPaths: ((json: string) => void) | undefined;
|
|
100
|
+
var __rngpui_filePickerDone: ((json: string) => void) | undefined;
|
|
101
|
+
var __rngpui_audioStart: (() => Promise<{
|
|
102
|
+
ok?: boolean;
|
|
103
|
+
}>) | undefined;
|
|
104
|
+
var __rngpui_audioStop: (() => Promise<{
|
|
105
|
+
base64?: string;
|
|
106
|
+
mimeType?: string;
|
|
107
|
+
durationMs?: number;
|
|
108
|
+
}>) | undefined;
|
|
109
|
+
var __rngpui_audioCancel: (() => void) | undefined;
|
|
110
|
+
var __rngpui_audioOnLevel: ((cb: (level: number) => void) => () => void) | undefined;
|
|
111
|
+
}
|
|
112
|
+
export declare const FilePicker: {
|
|
113
|
+
pickPaths(options?: FilePickerOptions): Promise<string[]>;
|
|
114
|
+
_parse: typeof parseFilePickerPaths;
|
|
115
|
+
};
|
|
116
|
+
export type VoiceRecording = {
|
|
117
|
+
base64: string;
|
|
118
|
+
mimeType: "audio/wav";
|
|
119
|
+
durationMs: number;
|
|
120
|
+
};
|
|
121
|
+
export declare const VoiceRecorder: {
|
|
122
|
+
isAvailable(): boolean;
|
|
123
|
+
start(): Promise<void>;
|
|
124
|
+
stop(): Promise<VoiceRecording>;
|
|
125
|
+
cancel(): void;
|
|
126
|
+
onLevel(cb: (level: number) => void): () => void;
|
|
127
|
+
};
|
|
128
|
+
export declare function findNodeHandle(ref: unknown): number | null;
|
|
129
|
+
export declare const PanResponder: {
|
|
130
|
+
create(_config: unknown): {
|
|
131
|
+
panHandlers: Record<string, unknown>;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export declare const Vibration: {
|
|
135
|
+
vibrate(_pattern?: number | number[], _repeat?: boolean): void;
|
|
136
|
+
cancel(): void;
|
|
137
|
+
};
|
|
138
|
+
declare class EventEmitterStub {
|
|
139
|
+
addListener(_event: string, _cb: (...args: unknown[]) => void): Sub;
|
|
140
|
+
removeAllListeners(_event?: string): void;
|
|
141
|
+
removeSubscription(_sub: unknown): void;
|
|
142
|
+
emit(_event: string, ..._args: unknown[]): void;
|
|
143
|
+
listenerCount(_event: string): number;
|
|
144
|
+
}
|
|
145
|
+
export declare const DeviceEventEmitter: EventEmitterStub;
|
|
146
|
+
export declare class NativeEventEmitter extends EventEmitterStub {
|
|
147
|
+
constructor(_nativeModule?: unknown);
|
|
148
|
+
}
|
|
149
|
+
export declare const AccessibilityInfo: {
|
|
150
|
+
addEventListener: () => Sub;
|
|
151
|
+
removeEventListener(): void;
|
|
152
|
+
isScreenReaderEnabled(): Promise<boolean>;
|
|
153
|
+
isReduceMotionEnabled(): Promise<boolean>;
|
|
154
|
+
announceForAccessibility(_message: string): void;
|
|
155
|
+
setAccessibilityFocus(_reactTag: number): void;
|
|
156
|
+
};
|
|
157
|
+
export declare const LogBox: {
|
|
158
|
+
ignoreAllLogs(_ignore?: boolean): void;
|
|
159
|
+
ignoreLogs(_patterns: Array<string | RegExp>): void;
|
|
160
|
+
};
|
|
161
|
+
export declare const TurboModuleRegistry: {
|
|
162
|
+
get<T>(_name: string): T | null;
|
|
163
|
+
getEnforcing<T>(_name: string): T;
|
|
164
|
+
};
|
|
165
|
+
declare function parseFilePickerPaths(value: unknown): string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type AppStateStatus = "active" | "inactive" | "background";
|
|
2
|
+
export type WindowFocusEvent = {
|
|
3
|
+
windowId: number;
|
|
4
|
+
focused: boolean;
|
|
5
|
+
};
|
|
6
|
+
type AppStateListenerMap = {
|
|
7
|
+
change: (state: AppStateStatus) => void;
|
|
8
|
+
focus: () => void;
|
|
9
|
+
blur: () => void;
|
|
10
|
+
windowFocus: (event: WindowFocusEvent) => void;
|
|
11
|
+
};
|
|
12
|
+
export type AppStateEventType = keyof AppStateListenerMap;
|
|
13
|
+
export declare const AppState: {
|
|
14
|
+
readonly currentState: AppStateStatus;
|
|
15
|
+
isAvailable: boolean;
|
|
16
|
+
readonly focusedWindowId: number | null;
|
|
17
|
+
isWindowFocused(windowId?: number): boolean;
|
|
18
|
+
addEventListener<K extends AppStateEventType>(type: K, handler: AppStateListenerMap[K]): {
|
|
19
|
+
remove: () => void;
|
|
20
|
+
};
|
|
21
|
+
removeEventListener<K extends AppStateEventType>(type: K, handler: AppStateListenerMap[K]): void;
|
|
22
|
+
};
|
|
23
|
+
export declare function applyAppStateEvent(state: "active" | "inactive", windowId: number | null): void;
|
|
24
|
+
export declare function applyWindowFocus(windowId: number, focused: boolean): void;
|
|
25
|
+
export declare function useAppState(): AppStateStatus;
|
|
26
|
+
export declare function useWindowFocused(): boolean;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { ViewProps } from "./types";
|
|
2
|
+
export type ChatListTextElement = {
|
|
3
|
+
kind: "text";
|
|
4
|
+
text: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
italic?: boolean;
|
|
8
|
+
link?: string;
|
|
9
|
+
trailingSpace?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type ChatListUserElement = {
|
|
12
|
+
kind: "user";
|
|
13
|
+
text: string;
|
|
14
|
+
login: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
bold?: boolean;
|
|
17
|
+
trailingSpace?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type ChatListEmoteElement = {
|
|
20
|
+
kind: "emote";
|
|
21
|
+
name: string;
|
|
22
|
+
url: string;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
zeroWidth?: boolean;
|
|
26
|
+
tooltip?: string;
|
|
27
|
+
tooltipImage?: string;
|
|
28
|
+
link?: string;
|
|
29
|
+
trailingSpace?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type ChatListBadgeElement = {
|
|
32
|
+
kind: "badge";
|
|
33
|
+
name: string;
|
|
34
|
+
url: string;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
background?: string;
|
|
38
|
+
tooltip?: string;
|
|
39
|
+
tooltipImage?: string;
|
|
40
|
+
trailingSpace?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type ChatListElement = ChatListTextElement | ChatListUserElement | ChatListEmoteElement | ChatListBadgeElement;
|
|
43
|
+
export type ChatListMessage = {
|
|
44
|
+
id: string;
|
|
45
|
+
timestamp?: string;
|
|
46
|
+
elements: ChatListElement[];
|
|
47
|
+
reply?: ChatListElement[];
|
|
48
|
+
background?: string;
|
|
49
|
+
marker?: string;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
historical?: boolean;
|
|
52
|
+
hidden?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type ChatListMessagePatch = {
|
|
55
|
+
id: string;
|
|
56
|
+
} & Partial<Omit<ChatListMessage, "id">>;
|
|
57
|
+
export type ChatListTargetKind = "user" | "link" | "emote" | "badge" | "message";
|
|
58
|
+
export type ChatListPressEvent = {
|
|
59
|
+
target: ChatListTargetKind;
|
|
60
|
+
messageId: string;
|
|
61
|
+
button: "left" | "right" | "middle";
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
shiftKey: boolean;
|
|
65
|
+
ctrlKey: boolean;
|
|
66
|
+
altKey: boolean;
|
|
67
|
+
metaKey: boolean;
|
|
68
|
+
login?: string;
|
|
69
|
+
url?: string;
|
|
70
|
+
name?: string;
|
|
71
|
+
link?: string;
|
|
72
|
+
tooltip?: string;
|
|
73
|
+
tooltipImage?: string;
|
|
74
|
+
};
|
|
75
|
+
export type ChatListHoverEvent = {
|
|
76
|
+
target: Exclude<ChatListTargetKind, "message">;
|
|
77
|
+
messageId: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
tooltip?: string;
|
|
80
|
+
tooltipImage?: string;
|
|
81
|
+
url?: string;
|
|
82
|
+
login?: string;
|
|
83
|
+
link?: string;
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
pointerX: number;
|
|
89
|
+
pointerY: number;
|
|
90
|
+
};
|
|
91
|
+
export type ChatListScrollState = {
|
|
92
|
+
atBottom: boolean;
|
|
93
|
+
paused: boolean;
|
|
94
|
+
unseen: number;
|
|
95
|
+
};
|
|
96
|
+
export type ChatListProps = ViewProps & {
|
|
97
|
+
fontSize?: number;
|
|
98
|
+
fontFamily?: string;
|
|
99
|
+
textColor?: string;
|
|
100
|
+
mutedColor?: string;
|
|
101
|
+
linkColor?: string;
|
|
102
|
+
selectionColor?: string;
|
|
103
|
+
separatorColor?: string;
|
|
104
|
+
alternateBackground?: string;
|
|
105
|
+
scrollbarColor?: string;
|
|
106
|
+
disabledOpacity?: number;
|
|
107
|
+
historicalOpacity?: number;
|
|
108
|
+
showTimestamps?: boolean;
|
|
109
|
+
emoteScale?: number;
|
|
110
|
+
animateEmotes?: boolean;
|
|
111
|
+
maxMessages?: number;
|
|
112
|
+
pauseOnHover?: boolean;
|
|
113
|
+
onPress?: (event: {
|
|
114
|
+
nativeEvent: ChatListPressEvent;
|
|
115
|
+
}) => void;
|
|
116
|
+
onHover?: (event: {
|
|
117
|
+
nativeEvent: ChatListHoverEvent | null;
|
|
118
|
+
}) => void;
|
|
119
|
+
onScrollState?: (event: {
|
|
120
|
+
nativeEvent: ChatListScrollState;
|
|
121
|
+
}) => void;
|
|
122
|
+
};
|
|
123
|
+
export type ChatListRevealAlign = "top" | "center" | "bottom";
|
|
124
|
+
export interface ChatListHandle {
|
|
125
|
+
append(messages: ChatListMessage[]): void;
|
|
126
|
+
prepend(messages: ChatListMessage[]): void;
|
|
127
|
+
update(patches: ChatListMessagePatch[]): void;
|
|
128
|
+
clear(): void;
|
|
129
|
+
scrollToBottom(): void;
|
|
130
|
+
scrollToTop(): void;
|
|
131
|
+
scrollToMessage(messageId: string, options?: {
|
|
132
|
+
align?: ChatListRevealAlign;
|
|
133
|
+
}): void;
|
|
134
|
+
pageUp(): void;
|
|
135
|
+
pageDown(): void;
|
|
136
|
+
}
|
package/dist/colors.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ColorValue, DynamicColorIOSValue, PlatformColorValue } from "./types";
|
|
2
|
+
export type ColorSchemeName = "light" | "dark" | null;
|
|
3
|
+
export type DynamicColorIOSTuple = {
|
|
4
|
+
light: ColorValue;
|
|
5
|
+
dark: ColorValue;
|
|
6
|
+
highContrastLight?: ColorValue;
|
|
7
|
+
highContrastDark?: ColorValue;
|
|
8
|
+
};
|
|
9
|
+
type AppearanceListener = (prefs: {
|
|
10
|
+
colorScheme: ColorSchemeName;
|
|
11
|
+
}) => void;
|
|
12
|
+
export declare function setAppearanceUpdateSink(sink: (() => void) | undefined): void;
|
|
13
|
+
/**
|
|
14
|
+
* Native pushed the system color scheme — the initial value when the window opens,
|
|
15
|
+
* then again whenever macOS toggles light/dark. Updates the system value and
|
|
16
|
+
* re-themes, unless a manual `setColorScheme` override is currently masking it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function applyNativeColorScheme(scheme: ColorSchemeName): void;
|
|
19
|
+
export declare const Appearance: {
|
|
20
|
+
getColorScheme(): ColorSchemeName;
|
|
21
|
+
setColorScheme(scheme: ColorSchemeName): void;
|
|
22
|
+
addChangeListener(listener: AppearanceListener): {
|
|
23
|
+
remove(): void;
|
|
24
|
+
};
|
|
25
|
+
removeChangeListener(listener: unknown): void;
|
|
26
|
+
};
|
|
27
|
+
export declare function useColorScheme(): ColorSchemeName;
|
|
28
|
+
export declare function DynamicColorIOS(tuple: DynamicColorIOSTuple): DynamicColorIOSValue;
|
|
29
|
+
export declare function PlatformColor(...names: string[]): PlatformColorValue;
|
|
30
|
+
export declare function resolveColorValue(color: unknown): unknown;
|
|
31
|
+
export declare function processColor(color: unknown): unknown;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import type { ChatListMessage, ChatListMessagePatch, ChatListRevealAlign } from "./chat-list-types";
|
|
2
|
+
import { type RendererProvenance } from "./runtime";
|
|
3
|
+
export type AppCommandBinding = {
|
|
4
|
+
id: string;
|
|
5
|
+
key: string;
|
|
6
|
+
context?: string;
|
|
7
|
+
};
|
|
8
|
+
export type AppCommandMenuItem = {
|
|
9
|
+
kind: "action";
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "separator";
|
|
14
|
+
} | {
|
|
15
|
+
kind: "submenu";
|
|
16
|
+
label: string;
|
|
17
|
+
items: AppCommandMenuItem[];
|
|
18
|
+
};
|
|
19
|
+
export type NativeMenuCommandItem = {
|
|
20
|
+
kind: "action";
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
checked?: boolean;
|
|
25
|
+
destructive?: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "label";
|
|
28
|
+
label: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "separator";
|
|
31
|
+
} | {
|
|
32
|
+
kind: "submenu";
|
|
33
|
+
label: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
items: NativeMenuCommandItem[];
|
|
36
|
+
};
|
|
37
|
+
export type AppCommandMenu = {
|
|
38
|
+
label: string;
|
|
39
|
+
items: AppCommandMenuItem[];
|
|
40
|
+
};
|
|
41
|
+
export type AppCommandConfig = {
|
|
42
|
+
bindings: AppCommandBinding[];
|
|
43
|
+
menus: AppCommandMenu[];
|
|
44
|
+
};
|
|
45
|
+
export type Command = {
|
|
46
|
+
$cmd: "windowSize";
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
} | {
|
|
50
|
+
$cmd: "eval";
|
|
51
|
+
id: number;
|
|
52
|
+
js: string;
|
|
53
|
+
} | {
|
|
54
|
+
$cmd: "reload";
|
|
55
|
+
id: number;
|
|
56
|
+
} | {
|
|
57
|
+
$cmd: "scrollTo";
|
|
58
|
+
id: number;
|
|
59
|
+
x?: number;
|
|
60
|
+
y?: number;
|
|
61
|
+
} | {
|
|
62
|
+
$cmd: "scrollToEnd";
|
|
63
|
+
id: number;
|
|
64
|
+
} | {
|
|
65
|
+
$cmd: "chatList";
|
|
66
|
+
id: number;
|
|
67
|
+
op: "append" | "prepend";
|
|
68
|
+
messages: ChatListMessage[];
|
|
69
|
+
} | {
|
|
70
|
+
$cmd: "chatList";
|
|
71
|
+
id: number;
|
|
72
|
+
op: "update";
|
|
73
|
+
patches: ChatListMessagePatch[];
|
|
74
|
+
} | {
|
|
75
|
+
$cmd: "chatList";
|
|
76
|
+
id: number;
|
|
77
|
+
op: "clear" | "scrollToBottom" | "scrollToTop";
|
|
78
|
+
} | {
|
|
79
|
+
$cmd: "chatList";
|
|
80
|
+
id: number;
|
|
81
|
+
op: "scrollToMessage";
|
|
82
|
+
messageId: string;
|
|
83
|
+
align?: ChatListRevealAlign;
|
|
84
|
+
} | {
|
|
85
|
+
$cmd: "chatList";
|
|
86
|
+
id: number;
|
|
87
|
+
op: "page";
|
|
88
|
+
direction: -1 | 1;
|
|
89
|
+
} | {
|
|
90
|
+
$cmd: "nativeLayout";
|
|
91
|
+
key: string;
|
|
92
|
+
width?: number;
|
|
93
|
+
height?: number;
|
|
94
|
+
x?: number;
|
|
95
|
+
y?: number;
|
|
96
|
+
animateMs?: number;
|
|
97
|
+
clear?: boolean;
|
|
98
|
+
} | {
|
|
99
|
+
$cmd: "focusInput";
|
|
100
|
+
id: number;
|
|
101
|
+
} | {
|
|
102
|
+
$cmd: "clearInput";
|
|
103
|
+
id: number;
|
|
104
|
+
} | {
|
|
105
|
+
$cmd: "blurInput";
|
|
106
|
+
id: number;
|
|
107
|
+
} | {
|
|
108
|
+
$cmd: "dockBadge";
|
|
109
|
+
label: string;
|
|
110
|
+
} | {
|
|
111
|
+
$cmd: "requestAttention";
|
|
112
|
+
critical?: boolean;
|
|
113
|
+
} | {
|
|
114
|
+
$cmd: "openWindow";
|
|
115
|
+
} | {
|
|
116
|
+
$cmd: "openURL";
|
|
117
|
+
url: string;
|
|
118
|
+
} | {
|
|
119
|
+
$cmd: "quickLook";
|
|
120
|
+
url: string;
|
|
121
|
+
filename: string;
|
|
122
|
+
} | {
|
|
123
|
+
$cmd: "appTint";
|
|
124
|
+
color: string | null;
|
|
125
|
+
} | {
|
|
126
|
+
$cmd: "nativeContextMenu";
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
items: NativeMenuCommandItem[];
|
|
130
|
+
closeId?: string;
|
|
131
|
+
} | {
|
|
132
|
+
$cmd: "clipboardWrite";
|
|
133
|
+
text: string;
|
|
134
|
+
} | {
|
|
135
|
+
$cmd: "performanceHud";
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
} | {
|
|
138
|
+
$cmd: "rendererProvenance";
|
|
139
|
+
requestId: number;
|
|
140
|
+
} | {
|
|
141
|
+
$cmd: "imagePrefetch";
|
|
142
|
+
urls: string[];
|
|
143
|
+
requestId: number;
|
|
144
|
+
} | {
|
|
145
|
+
$cmd: "httpPreconnect";
|
|
146
|
+
origins: string[];
|
|
147
|
+
} | ({
|
|
148
|
+
$cmd: "appCommands";
|
|
149
|
+
} & AppCommandConfig);
|
|
150
|
+
export declare function setCommandSink(fn: (cmd: Command) => void): void;
|
|
151
|
+
export declare function sendCommand(cmd: Command): void;
|
|
152
|
+
export type NativeLayoutAnimationOptions = {
|
|
153
|
+
animateMs?: number;
|
|
154
|
+
};
|
|
155
|
+
export declare const NativeLayout: {
|
|
156
|
+
setSize(key: string, size: {
|
|
157
|
+
width?: number;
|
|
158
|
+
height?: number;
|
|
159
|
+
x?: number;
|
|
160
|
+
y?: number;
|
|
161
|
+
}, options?: NativeLayoutAnimationOptions): void;
|
|
162
|
+
setFrame(key: string, frame: {
|
|
163
|
+
width?: number;
|
|
164
|
+
height?: number;
|
|
165
|
+
x?: number;
|
|
166
|
+
y?: number;
|
|
167
|
+
}, options?: NativeLayoutAnimationOptions): void;
|
|
168
|
+
setWidth(key: string, width: number, options?: NativeLayoutAnimationOptions): void;
|
|
169
|
+
setHeight(key: string, height: number, options?: NativeLayoutAnimationOptions): void;
|
|
170
|
+
setX(key: string, x: number, options?: NativeLayoutAnimationOptions): void;
|
|
171
|
+
animateSize(key: string, size: {
|
|
172
|
+
width?: number;
|
|
173
|
+
height?: number;
|
|
174
|
+
x?: number;
|
|
175
|
+
y?: number;
|
|
176
|
+
}, animateMs?: number): void;
|
|
177
|
+
animateFrame(key: string, frame: {
|
|
178
|
+
width?: number;
|
|
179
|
+
height?: number;
|
|
180
|
+
x?: number;
|
|
181
|
+
y?: number;
|
|
182
|
+
}, animateMs?: number): void;
|
|
183
|
+
animateWidth(key: string, width: number, animateMs?: number): void;
|
|
184
|
+
animateHeight(key: string, height: number, animateMs?: number): void;
|
|
185
|
+
animateX(key: string, x: number, animateMs?: number): void;
|
|
186
|
+
clear(key: string): void;
|
|
187
|
+
};
|
|
188
|
+
export declare const Dock: {
|
|
189
|
+
setBadge(label: string | null): void;
|
|
190
|
+
requestAttention(critical?: boolean): void;
|
|
191
|
+
};
|
|
192
|
+
export declare const NativeWindow: {
|
|
193
|
+
open(): void;
|
|
194
|
+
setTint(color: string | null): void;
|
|
195
|
+
};
|
|
196
|
+
export declare const NativeClipboard: {
|
|
197
|
+
setString(text: string): void;
|
|
198
|
+
read(): Promise<string>;
|
|
199
|
+
};
|
|
200
|
+
export declare const PerformanceHUD: {
|
|
201
|
+
setEnabled(enabled: boolean): void;
|
|
202
|
+
};
|
|
203
|
+
export declare const QuickLook: {
|
|
204
|
+
preview(url: string, filename: string): void;
|
|
205
|
+
};
|
|
206
|
+
export declare const Renderer: {
|
|
207
|
+
getProvenance(): Promise<RendererProvenance>;
|
|
208
|
+
};
|
|
209
|
+
export declare function resolveRendererProvenance(requestId: number, provenance: RendererProvenance): void;
|
|
210
|
+
export declare const ImageCache: {
|
|
211
|
+
prefetch(urls: string | readonly string[]): Promise<boolean>;
|
|
212
|
+
preconnect(origins: string | readonly string[]): void;
|
|
213
|
+
};
|
|
214
|
+
export declare function resolveImagePrefetch(requestId: number, loaded: boolean): void;
|
|
215
|
+
export declare const NativeMenus: {
|
|
216
|
+
showContextMenu({ x, y, items, closeId, }: {
|
|
217
|
+
x: number;
|
|
218
|
+
y: number;
|
|
219
|
+
items: NativeMenuCommandItem[];
|
|
220
|
+
closeId?: string;
|
|
221
|
+
}): void;
|
|
222
|
+
registerCallback(callback: () => void): string;
|
|
223
|
+
unregisterCallback(id: string): void;
|
|
224
|
+
_emit(id: string): boolean;
|
|
225
|
+
};
|
|
226
|
+
export declare const AppCommands: {
|
|
227
|
+
configure(config: AppCommandConfig): void;
|
|
228
|
+
addListener(listener: (id: string) => void): () => void;
|
|
229
|
+
_emit(id: string): void;
|
|
230
|
+
};
|