Bootstrap ProjectReactRuntime package

This commit is contained in:
Quixos Todo bootstrap
2026-09-05 10:18:09 -07:00
commit 9bbed0910e
20 changed files with 1452 additions and 0 deletions
@@ -0,0 +1,26 @@
// @generated by camino-codegen-ts-runtime. Do not edit.
import {
createWebStudioComponent,
type ReactComponentHostProps,
type ObjectRef,
} from "@quixos/web-studio-react-runtime";
export type ProjectReactComponentRenderProps = {
"compact"?: boolean;
};
export type Empty = {
};
export type ProjectComponentProps = {
forObject: ObjectRef<"atom:project">;
} & ProjectReactComponentRenderProps & ReactComponentHostProps<Record<string, never>>;
export const ProjectComponent = createWebStudioComponent<
ObjectRef<"atom:project">,
ProjectReactComponentRenderProps,
Record<string, never>
>({
expectedAtomId: "atom:project",
});
@@ -0,0 +1,29 @@
// @generated by camino-codegen-ts-runtime. Do not edit.
import {
createWebStudioComponent,
type ReactComponentHostProps,
type ObjectRef,
} from "@quixos/web-studio-react-runtime";
export type TodoReactComponentRenderProps = {
"selected"?: boolean;
"compact"?: boolean;
};
export type TodoReactComponentAction = {
"type"?: TodoReactComponentActionType;
};
export type TodoReactComponentActionType = "TODO_REACT_COMPONENT_ACTION_TYPE_UNSPECIFIED" | "SELECT";
export type TodoComponentProps = {
forObject: ObjectRef<"atom:task">;
} & TodoReactComponentRenderProps & ReactComponentHostProps<TodoReactComponentAction>;
export const TodoComponent = createWebStudioComponent<
ObjectRef<"atom:task">,
TodoReactComponentRenderProps,
TodoReactComponentAction
>({
expectedAtomId: "atom:task",
});
+54
View File
@@ -0,0 +1,54 @@
declare module "@quixos/web-studio-react-runtime" {
export type ObjectRef<AtomId extends string> = string & {
readonly $quixosAtom: AtomId;
};
export type LiveFieldProp<T> = {
value: T;
source: {
objectId: string;
slotId: string;
valueType?: string;
storagePolicy?: string;
revision?: string | number | bigint;
crdtSnapshot?: {
type: string;
encoding: string;
payload: string;
};
};
};
export type ReactComponentHostProps<Action> = {
onAction?: (action: Action) => void;
fallback?: unknown;
className?: string;
style?: Record<string, string | number | undefined>;
onError?: (error: Error) => void;
};
export type ReactComponentImplementationProps<CaminoProps, RenderProps, Action> = {
camino: CaminoProps;
render: RenderProps;
dispatch: (action: Action) => void;
};
export const createWebStudioComponent: <
ForObject extends ObjectRef<string>, RenderProps extends object, Action,
>(config: { expectedAtomId: string }) => (props: {
forObject: ForObject;
} & RenderProps & ReactComponentHostProps<Action>) => any;
export const invokeCapability: <Result = unknown>(
objectId: string,
interfaceRevisionId: string,
operationId: string,
value?: unknown,
) => Promise<Result>;
export const h: (...args: any[]) => any;
export const useLiveField: <T>(
field: LiveFieldProp<T>,
options?: {
reconcileRegister?: (state: {
confirmed: T;
optimistic: T;
pending: boolean;
}) => T;
},
) => [T, (value: T) => void | Promise<void>];
}