/* 생성 파일 */ import type { PaletteId, Breakpoint } from "./types.js"; export interface PaletteInfo { id: PaletteId; name: string; group: "caffeine" | "web"; description: string; swatch: { light: string; dark: string } } /** 팔레트 목록 */ export declare const palettes: PaletteInfo[]; /** 컴포넌트가 그리는 문구(2.1). setLocale("en") 또는 일부만 덮어쓴 객체. */ export interface Locale { id: string; errorPrefix: string; back: string; close: string; more: string; prevMonth: string; nextMonth: string; dow: string[]; monthTitle: (y: number, m: number) => string; dayLabel: (y: number, m: number, d: number, dow: string) => string; palette: string; mainMenu: string; siteMenu: string; menu: string; loading: string; dismiss: string; prevPage: string; nextPage: string; page: (n: number) => string; pageOf: (n: number, total: number) => string; tabs: string; notifications: string; openInNew: string; } /** 내장 로케일: ko(기본)·en */ export declare const locales: { ko: Locale; en: Locale }; /** 로케일을 정합니다. 문자열("ko" | "en") 또는 ko를 바탕으로 일부만 덮어쓴 객체. */ export declare function setLocale(locale: "ko" | "en" | Partial): void; export declare function getLocale(): Locale; /** 로케일이 바뀔 때마다 호출. 해제 함수를 돌려줍니다. */ export declare function onLocaleChange(cb: (locale: Locale) => void): () => void; /** 브레이크포인트 min-width(px) */ export declare const breakpoints: { sm: 600; md: 768; lg: 1120; xl: 1440 }; /** 팔레트를 바꿉니다. el을 주면 그 요소 아래만. */ export declare function setPalette(id: PaletteId | (string & {}), el?: HTMLElement): boolean; export declare function getPalette(el?: HTMLElement): PaletteId | (string & {}); /** "system"이면 시스템 설정을 따릅니다. */ export declare function setTheme(theme: "light" | "dark" | "system", el?: HTMLElement): void; export declare function getTheme(el?: HTMLElement): "light" | "dark"; export declare function getBreakpoint(width?: number): Breakpoint; export declare function isAtLeast(bp: Breakpoint, width?: number): boolean; /** 단계가 바뀔 때마다 호출. 해제 함수를 돌려줍니다. */ export declare function onBreakpointChange(cb: (bp: Breakpoint) => void): () => void; export interface LowEndOptions { /** 메모리(GB)가 이보다 작으면 저사양. 기본 4 (메모리를 알려 주는 Chromium에서만) */ minMemory?: number; /** 코어가 이보다 적으면 저사양. 기본 4 (메모리를 알려 주는 브라우저에서만 봅니다) */ minCores?: number; } /** 저사양 기기·절전·투명도 줄이기 설정이면 true */ export declare function shouldReduceCrema(options?: LowEndOptions): boolean; /** 데스크톱 모드를 켤 만한 기기인지 (lg 이상, 마우스, 코어 6개·메모리 8GB 이상) */ export declare function isDesktopCapable(): boolean; export type CremaMode = "off" | "on" | "rich"; export interface CremaOptions extends LowEndOptions { /** 데스크톱 모드. "auto"(기본)는 데스크톱일 때만 켭니다. false면 끕니다. */ rich?: boolean | "auto"; /** 데스크톱 모드에서 포인터를 따라오는 빛. 2.0부터 기본 false(마우스를 움직일 때마다 크레마 면을 다시 칠하므로 선택 기능). 동작 줄이기 설정이면 켜도 꺼집니다. */ pointerLight?: boolean; /** true면 기기 판단 없이 크레마를 켜고, false면 끕니다. */ force?: boolean; /** true면 probeCremaCost()로 실제 블러 비용을 재서 느리면 off로 바꿉니다(2.1). 메모리를 알려 주지 않는 Safari·Firefox용. */ probe?: boolean; /** probe의 한 프레임 허용 ms. 기본 24 */ slowMs?: number; } /** * 를 정합니다. 크레마가 켜졌으면 true. * applyCremaPreference() · applyCremaPreference({ rich: false }) · applyCremaPreference(false) */ export declare function applyCremaPreference(options?: boolean | CremaOptions): boolean; /** 크레마 모드를 바로 정합니다. "auto"는 applyCremaPreference()와 같습니다. */ export declare function setCremaMode(mode: CremaMode | "auto"): boolean; export declare function getCremaMode(): CremaMode; export interface CremaIssue { /** blur-budget: 블러 면이 예산보다 많음 · primary: primary 버튼이 둘 이상 · palette: 영역별 팔레트(한 화면에 하나) · accent-area: 강조색 면이 10% 초과(90/10) · legacy-glass: 2.0에서 제거된 1.4 이름(glass)을 쓰는 요소 */ code: "blur-budget" | "primary" | "palette" | "accent-area" | "legacy-glass"; message: string; elements: Element[]; } export interface CremaAuditOptions { /** 블러 예산. 기본: 모드에 따라 off 0 · on 3 · rich 6 */ budget?: number; /** true면 bl- 클래스가 아닌 요소의 backdrop-filter까지 셉니다(느림) */ all?: boolean; /** 강조색 면의 허용 비율. 기본 0.1 (90/10) */ accentMax?: number; } /** 블러 비용을 실제로 재 봅니다(2.1). 느린 기기면 true. applyCremaPreference({ probe: true })가 씁니다. */ export declare function probeCremaCost(options?: { /** 한 프레임 허용 ms. 기본 24 */ slowMs?: number }): Promise; /** 지금 화면을 한 번 검사합니다(화면에 보이는 것만). 서버에서는 []. */ export declare function checkCrema(options?: CremaAuditOptions): CremaIssue[]; /** 개발 중에 화면이 바뀔 때마다 검사해 새 문제를 콘솔에 알립니다. 배포 빌드에서는 아무것도 하지 않습니다. 멈추는 함수를 돌려줍니다. */ export declare function auditCrema(options?: CremaAuditOptions & { onReport?: (issues: CremaIssue[]) => void; force?: boolean }): () => void; export interface PaletteValues { accent: string; "accent-soft": string; "on-accent": string; "accent-ink": string; deco: string; "crema-tint-accent": string; } export interface PaletteWarning { code: "adjusted" | "danger" | "warning" | "positive" | "neutral"; message: string } export interface CustomPalette { id: string; name: string; group: "custom"; /** 넣은 색 (#rrggbb) */ source: string; /** 대비를 맞추려고 라이트 강조색을 바꿨으면 true */ adjusted: boolean; values: { light: PaletteValues; dark: PaletteValues }; warnings: PaletteWarning[]; } export interface BrandColorOptions { /** data-palette 값 (기본 "brand") */ id?: string; name?: string; /** 적용할 요소 (기본 ) */ target?: HTMLElement; /** false면