77 lines
2.1 KiB
TypeScript
77 lines
2.1 KiB
TypeScript
import type { RecordModel } from 'pocketbase';
|
|
|
|
export type LogoBackground = 'light' | 'dark';
|
|
export type ProjectStatus = 'active' | 'archived';
|
|
|
|
export interface Project extends RecordModel {
|
|
name: string;
|
|
logo: string;
|
|
logo_bg: LogoBackground;
|
|
logo_bg_color: string;
|
|
brand_color: string;
|
|
button_text_color: string;
|
|
button_label: string;
|
|
// AR page options; missing keys fall back to AR_PAGE_DEFAULTS
|
|
ar_page: Partial<ArPageSettings> | null;
|
|
description: string;
|
|
status: ProjectStatus;
|
|
created: string;
|
|
updated: string;
|
|
}
|
|
|
|
export interface ColorPreset {
|
|
value: string;
|
|
label: string;
|
|
}
|
|
|
|
export interface ProjectSummary extends Project {
|
|
assetCount: number;
|
|
}
|
|
|
|
// What a client logo needs to render, whether it comes from a saved project or an unsaved form
|
|
export interface BrandIdentity {
|
|
name: string;
|
|
logoUrl?: string;
|
|
// Light/dark decides contrast (fallback text colour); a custom colour, when set, is painted behind the logo
|
|
logoBg: LogoBackground;
|
|
logoBgColor?: string;
|
|
}
|
|
|
|
export type ButtonSize = 'sm' | 'md' | 'lg' | 'full' | 'custom';
|
|
|
|
// Exact button measurements (px) for the "custom" size
|
|
export interface ButtonCustomSize {
|
|
height: number;
|
|
// Empty fits the label
|
|
width: number | null;
|
|
paddingX: number;
|
|
radius: number;
|
|
borderWidth: number;
|
|
borderColor: string;
|
|
}
|
|
|
|
// The AR page's "View in your space" button; anything unset falls back to thob's default
|
|
export interface ButtonStyle {
|
|
color?: string;
|
|
textColor?: string;
|
|
label?: string;
|
|
size?: ButtonSize;
|
|
custom?: ButtonCustomSize;
|
|
}
|
|
|
|
// What the AR page shows around the model
|
|
export interface ArPageLayout {
|
|
// Top and bottom bars; off lets the model fill the screen, with the logo and button over it
|
|
bars: boolean;
|
|
modelName: boolean;
|
|
// The rounded backing behind the client logo
|
|
logoBacking: boolean;
|
|
thobLogo: boolean;
|
|
}
|
|
|
|
// Stored in projects.ar_page
|
|
export interface ArPageSettings extends ArPageLayout {
|
|
buttonSize: ButtonSize;
|
|
buttonCustom: ButtonCustomSize;
|
|
}
|