mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
0ee2a86129
* refactor: extract contracts workspace package * fix: preserve screenshot diff result contract * test: stabilize Android keyboard smoke
13 lines
540 B
TypeScript
13 lines
540 B
TypeScript
import { defineStringEnum } from './string-enum.ts';
|
|
|
|
export const SESSION_SURFACES = ['app', 'frontmost-app', 'desktop', 'menubar'] as const;
|
|
export type SessionSurface = (typeof SESSION_SURFACES)[number];
|
|
const SESSION_SURFACE_ENUM = defineStringEnum(SESSION_SURFACES, {
|
|
normalize: (raw) => raw.trim().toLowerCase(),
|
|
message: (value) => `Invalid surface: ${value}. Use ${SESSION_SURFACES.join('|')}.`,
|
|
});
|
|
|
|
export function parseSessionSurface(value: string | undefined): SessionSurface {
|
|
return SESSION_SURFACE_ENUM.parse(value);
|
|
}
|