Files
persionalBrand/packages/config/src/brand-contracts.ts
T

125 lines
3.1 KiB
TypeScript

import type { BrandTemplateKey } from "./template-keys.js";
import type { CapabilityKey } from "./template-keys.js";
import type { VisualTemplateKey } from "./template-keys.js";
export type BrandTemplateModuleType = "identity" | "trust" | "offering" | "inquiry" | "contact";
export interface BrandTemplateModuleDefinition {
key: string;
type: BrandTemplateModuleType;
title: string;
required: boolean;
}
export interface BrandTemplateFieldDefinition {
scope: string;
key: string;
label: string;
type: string;
required: boolean;
}
export interface BrandTemplateDefinition {
key: BrandTemplateKey;
version: string;
name: string;
description: string;
serviceCategories: string[];
trustContentTypes: string[];
modules: BrandTemplateModuleDefinition[];
fields: BrandTemplateFieldDefinition[];
capabilities: CapabilityKey[];
}
export interface VisualTemplateDefinition {
key: VisualTemplateKey;
version: string;
name: string;
description: string;
supportedIndustryTemplates: readonly BrandTemplateKey[];
variants: Record<string, string>;
theme: { colors: Record<string, string>; radius: Record<string, string> };
layout?: { home: string[]; offerings: string[]; detail: string[]; profile: string[] };
}
export type VisualPageKey =
"home" | "offerings" | "detail" | "inquiry" | "success" | "records" | "profile";
export type VisualModuleType =
| "brand-identity"
| "hero"
| "trust"
| "offering-list"
| "offering-detail"
| "inquiry-form"
| "success-summary"
| "records-list"
| "contact";
export interface VisualTokenSet {
colors: Record<string, string>;
spacing: Record<string, string>;
typography: Record<string, string>;
radius: Record<string, string>;
shadows?: Record<string, string>;
}
export interface VisualAssetSlot {
key: string;
label: string;
required: boolean;
kind: "image" | "icon" | "logo" | "texture";
aspectRatio?: string;
fallback?: string;
}
export interface VisualDataSlot {
key: string;
source: "brand" | "trust" | "offering" | "inquiry" | "records" | "profile";
required: boolean;
description: string;
}
export interface VisualModuleDefinition {
key: string;
type: VisualModuleType;
variant: string;
required: boolean;
dataSlots?: string[];
assetSlots?: string[];
capability?: CapabilityKey;
}
export interface VisualPageDefinition {
key: VisualPageKey;
title: string;
renderer?: string;
modules: VisualModuleDefinition[];
}
export interface VisualTemplateManifest {
schemaVersion: "1.0";
key: VisualTemplateKey;
version: string;
name: string;
description: string;
supportedIndustryTemplates: BrandTemplateKey[];
brandFirst: true;
tokens: VisualTokenSet;
pages: VisualPageDefinition[];
assets: VisualAssetSlot[];
dataSlots: VisualDataSlot[];
capabilities: CapabilityKey[];
}
export interface TemplatePackage {
manifest: VisualTemplateManifest;
industryTemplateKey: BrandTemplateKey;
content: Record<string, unknown>;
forms: Record<string, unknown>[];
capabilityConfig: Record<string, unknown>;
fixtures: {
runtime: Record<string, unknown>;
visual: Record<string, unknown>;
};
}