openvibe-sdk/themes

Generated at from openvibe-contracts v0.221.0 and openvibe-sdk v0.65.0.

From types/themes.d.ts (both). Declarations are shown verbatim.

type ThemeVariables

export type ThemeVariables = Record<string, string>;

interface Season

theme: the dark half; light: its light half (Hayride for Halloween).

export interface Season { id: string; name: string; theme: string; light?: string; from: string; to: string }

interface Theme

export interface Theme {
    id: string; name: string; slug: string; description?: string; mode: 'dark' | 'light'; variables: ThemeVariables;
    preview_colors?: string[] | null; tags?: string[]; is_builtin?: number; downloads?: number;
    /** A seasonal theme: when it stands in for the default theme (MM-DD, both days included). */
    season?: { id: string; name: string; from: string; to: string };
    [field: string]: unknown;
}

interface DisplayPrefs

export interface DisplayPrefs { motion?: 'auto' | 'reduced'; text?: '100' | '112' | '125'; seasonal?: 'on' | 'off'; scheme?: 'manual' | 'auto' }

interface ActiveTheme

export interface ActiveTheme { theme_id: string | null; custom_variables?: ThemeVariables | null; display?: DisplayPrefs | null; guest?: boolean }

interface ThemesClient

export interface ThemesClient {
    catalog(query?: { mode?: 'dark' | 'light'; search?: string; sort?: 'downloads' | 'rating'; limit?: number }, opts?: Opts): Promise<{ themes: Theme[] }>;
    get(idOrSlug: string, opts?: Opts): Promise<Theme | null>;
    export(idOrSlug: string, opts?: Opts): Promise<{ format: 'openvibe-theme@1'; name: string; slug: string; mode: string; variables: ThemeVariables; [k: string]: unknown } | null>;
    active(opts?: Opts): Promise<ActiveTheme>;
    set(themeId: string, extra?: { custom?: ThemeVariables | null }, opts?: Opts): Promise<{ success: boolean; theme_id: string; custom_variables: ThemeVariables | null }>;
    setDisplay(patch: DisplayPrefs, opts?: Opts): Promise<{ ok: boolean; display: DisplayPrefs }>;
    seasons(query?: { date?: string }, opts?: Opts): Promise<{ seasons: Season[]; now: { id: string; name: string; theme: string } | null }>;
    submissions(opts?: Opts): Promise<{ themes: Theme[] }>;
    submit(theme: { name: string; description?: string; mode: 'dark' | 'light'; variables: ThemeVariables; tags?: string[] }, opts?: Opts): Promise<Record<string, unknown>>;
    import(file: Record<string, unknown>, opts?: Opts): Promise<Record<string, unknown>>;
}

interface ThemeSnapshot

export interface ThemeSnapshot {
    id: string | null;
    mode: 'dark' | 'light' | string;
    tokens: Record<string, string>;
    display: { motion: 'auto' | 'reduced'; text: '100' | '112' | '125'; seasonal: 'on' | 'off'; scheme: 'manual' | 'auto'; textScale: number; calm: boolean };
    season: { id: string } | null;
    seasonMark: string | null;
}

export export function createThemesClient(client: OpenVibeClient, o

export function createThemesClient(client: OpenVibeClient, opts?: { baseUrl?: string }): ThemesClient;

export export function followTheme(fn: (theme: ThemeSnapshot) => vo

export function followTheme(fn: (theme: ThemeSnapshot) => void, opts?: { root?: Element; names?: readonly string[] }): () => void;

export export function readTheme(opts?: { root?: Element; names?: r

export function readTheme(opts?: { root?: Element; names?: readonly string[] }): ThemeSnapshot;

export export function applyTheme(vars: ThemeVariables, opts?: { ro

export function applyTheme(vars: ThemeVariables, opts?: { root?: HTMLElement }): HTMLElement | null;

export export function seasonOn(date: Date | string | number | null

export function seasonOn(date: Date | string | number | null | undefined, seasons: Season[]): Season | null;

export export function onColor(hex: string): '#0b0d10' | '#ffffff'

export function onColor(hex: string): '#0b0d10' | '#ffffff' | null;

export export const DISPLAY_OPTIONS: Readonly<{ motion: string[]; t

export const DISPLAY_OPTIONS: Readonly<{ motion: string[]; text: string[]; seasonal: string[]; scheme: string[] }>;

export export const TOKENS: readonly string[];

export const TOKENS: readonly string[];