// Local copy of the @source/presence-sdk type contract used by presences in this repo. // Keep in sync with src/presence-sdk/index.ts in the extension. export declare const ActivityType: { readonly PLAYING: 0; readonly LISTENING: 2; readonly WATCHING: 3; }; export type ActivityTypeValue = (typeof ActivityType)[keyof typeof ActivityType]; export interface PresenceActivityInput { type: ActivityTypeValue; name: string; details?: string | null; state?: string | null; url?: string | null; largeImage?: string | null; largeText?: string | null; smallImage?: string | null; smallText?: string | null; startedAt?: number | null; endsAt?: number | null; } export interface PresenceStorage { get(key: string): Promise; set(key: string, value: unknown): Promise; delete(key: string): Promise; clear(): Promise; } export interface PresenceContext { readonly url: string; readonly tabActive: boolean; readonly storage: PresenceStorage; setActivity(activity: PresenceActivityInput | null): void; clear(): void; log(...args: unknown[]): void; warn(...args: unknown[]): void; error(...args: unknown[]): void; } export interface PresenceDefinition { match: string[]; tickInterval?: number; onLoad?: (ctx: PresenceContext) => void | Promise; tick?: (ctx: PresenceContext) => void | Promise; onUnload?: (ctx: PresenceContext) => void | Promise; } export declare function definePresence(def: PresenceDefinition): PresenceDefinition; export type { PresenceDefinition as Presence };