Adding updates to fartmachine
This commit is contained in:
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
import type { GlitchComponentProps } from './types';
|
||||
export default function AssumptionToggle({ config, onComplete, onProgress, theme, className, host }: GlitchComponentProps): import("react/jsx-runtime").JSX.Element;
|
||||
Vendored
+560
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
import type { GlitchHostBridge } from './types';
|
||||
export type DevHostBridgeOptions = {
|
||||
isMuted?: () => boolean;
|
||||
onSound?: (id: string, payload?: Record<string, unknown>) => void;
|
||||
onEmit?: (type: string, payload?: unknown) => void;
|
||||
};
|
||||
export declare function createDevHostBridge(options?: DevHostBridgeOptions): GlitchHostBridge;
|
||||
export declare function attachWindowSoundBridge(host: GlitchHostBridge): () => void;
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
import type { GlitchHostBridge } from './types';
|
||||
export declare const HOST_SOUND_EVENT = "glitch:play-sound";
|
||||
export declare const HOST_STOP_SOUND_EVENT = "glitch:stop-sound";
|
||||
export declare const HOST_EMIT_PREFIX = "glitch:host:";
|
||||
export declare const SOUND_IDS: {
|
||||
readonly click: "ui.button_click";
|
||||
readonly hover: "ui.button_hover";
|
||||
readonly computeStart: "machine.compute_start";
|
||||
readonly computeStep: "machine.compute_step";
|
||||
readonly computeDone: "machine.compute_done";
|
||||
readonly verdictStable: "machine.verdict_stable";
|
||||
readonly verdictAlert: "machine.verdict_alert";
|
||||
};
|
||||
export type SoundId = (typeof SOUND_IDS)[keyof typeof SOUND_IDS];
|
||||
export declare function safePlaySound(host: GlitchHostBridge | undefined, id: string, payload?: Record<string, unknown>): void;
|
||||
export declare function safeStopSound(host: GlitchHostBridge | undefined, id: string, payload?: Record<string, unknown>): void;
|
||||
export declare function safeEmit(host: GlitchHostBridge | undefined, type: string, payload?: unknown): void;
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import './styles.css';
|
||||
import Component from './Component';
|
||||
import type { GlitchComponentMetadata } from './types';
|
||||
export default Component;
|
||||
export declare const metadata: GlitchComponentMetadata;
|
||||
export type { GlitchComponentProps, GlitchComponentConfig, GlitchComponentResult } from './types';
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
export interface GlitchComponentConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string;
|
||||
params: Record<string, unknown>;
|
||||
}
|
||||
export interface GlitchHostBridge {
|
||||
playSound?: (id: string, payload?: Record<string, unknown>) => void;
|
||||
stopSound?: (id: string, payload?: Record<string, unknown>) => void;
|
||||
emit?: (type: string, payload?: unknown) => void;
|
||||
}
|
||||
export interface GlitchComponentProps {
|
||||
config: GlitchComponentConfig;
|
||||
onComplete: (result: GlitchComponentResult) => void;
|
||||
onProgress?: (percent: number) => void;
|
||||
theme?: GlitchTheme;
|
||||
className?: string;
|
||||
host?: GlitchHostBridge;
|
||||
}
|
||||
export interface GlitchComponentResult {
|
||||
success: boolean;
|
||||
score?: number;
|
||||
data?: unknown;
|
||||
error?: string;
|
||||
}
|
||||
export interface GlitchTheme {
|
||||
primary: string;
|
||||
accent: string;
|
||||
bg: string;
|
||||
bgSecondary: string;
|
||||
text: string;
|
||||
textMuted: string;
|
||||
border: string;
|
||||
}
|
||||
export interface GlitchComponentMetadata {
|
||||
name: string;
|
||||
displayName: string;
|
||||
version: string;
|
||||
paramSchema: ParamSchema;
|
||||
defaultParams: Record<string, unknown>;
|
||||
}
|
||||
export interface ParamSchema {
|
||||
[key: string]: {
|
||||
type: 'number' | 'string' | 'boolean' | 'color' | 'select' | 'range';
|
||||
label?: string;
|
||||
description?: string;
|
||||
default: unknown;
|
||||
options?: {
|
||||
value: string | number;
|
||||
label: string;
|
||||
}[];
|
||||
min?: number;
|
||||
max?: number;
|
||||
step?: number;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user