import { SectionData, SectionAPI } from './server.js';
import * as zustand from 'zustand';
export { g as getLocale, b as getLocaleWithInfo, a as getLocales, c as getLocalesWithInfo, s as setLocale } from './actions-BEFWwQsh.js';
export { L as LOCALE_COOKIE_KEY, e as LOCALE_INFO_MAP, f as LocaleInfo, S as SupportedLocale, d as getDialCode, c as getFlag, g as getLocaleInfo, b as getSupportedLocales, i as isRTL } from './locale.constants-BNkSdNP1.js';
import './index-Dh5FjWzR.js';
import './server/repositories/index.js';
import './server/entities/cms-labels.js';
import 'drizzle-orm/pg-core';
import './server/entities/cms-label-values.js';
import './server/entities/cms-draft-cache.js';
import './server/entities/cms-published-cache.js';
import './server/entities/cms-audit-logs.js';
import './label-sync-generator-B0EmvtWM.js';
import '@spfn/core/codegen';
/**
* useSection Hook
*
* 클라이언트 컴포넌트에서 섹션 데이터 사용
*/
/**
* 섹션 Hook (서버 API와 동일한 패턴)
*
* @param section - 섹션 이름
* @param options - 옵션 (autoLoad: 자동 로드 여부)
* @returns { t, data, loading }
*
* @example
* ```tsx
* 'use client';
* import { useSection } from '@spfn/cms/client';
*
* export function ClientComponent()
* {
* const { t } = useSection('home', { autoLoad: true });
* return
{t('hero.title')}
;
* }
* ```
*/
declare function useSection(section: string, options?: {
autoLoad?: boolean;
locale?: string;
}): {
t: (key: string, defaultValue?: any, replace?: Record) => any;
data: SectionData;
loading: boolean;
};
/**
* useSections Hook
*
* 여러 섹션을 한번에 사용
*/
/**
* 여러 섹션 Hook
*
* @param sectionNames - 섹션 이름 배열
* @returns { [section]: { t, data, loading }, ... }
*
* @example
* ```tsx
* 'use client';
* import { useSections } from '@spfn/cms/client';
*
* export function Component()
* {
* const sections = useSections(['home', 'layout']);
* return (
*
*
{sections.home.t('hero.title')}
*
{sections.layout.t('footer.copyright')}
*
* );
* }
* ```
*/
declare function useSections(sectionNames: string[]): Record) => any;
data: SectionData;
loading: boolean;
}>;
interface CmsState {
/**
* 섹션별 데이터
* { 'home': { section: 'home', content: {...}, version: 1, ... }, ... }
*/
sections: Record;
/**
* 로딩 상태
*/
loading: Record;
/**
* 섹션 데이터 설정 (서버에서 초기화용)
*/
setSection: (section: string, data: SectionData) => void;
/**
* 여러 섹션 한번에 설정
*/
setSections: (sections: Record) => void;
/**
* 섹션 비동기 로드
*/
loadSection: (section: string, locale?: string) => Promise;
/**
* 라벨 업데이트 (Draft Mode용)
*/
updateLabel: (section: string, key: string, value: any) => void;
/**
* 초기화
*/
reset: () => void;
}
declare const useCmsStore: zustand.UseBoundStore>;
/**
* CMS Store Initializer
*
* 서버 컴포넌트에서 로드한 섹션 데이터를 클라이언트 store에 초기화
*/
interface InitCmsProps {
/**
* 서버에서 로드한 섹션 데이터
* { home: { t, data }, ... }
*/
sections: Record;
}
/**
* CMS Store 초기화 컴포넌트
*
* 서버 컴포넌트에서 로드한 데이터를 클라이언트 store에 주입
* 이후 하위 클라이언트 컴포넌트에서 useSection() 사용 가능
*
* @param props - InitCmsProps
* @param props.sections - 서버에서 로드한 섹션 데이터
*
* @example
* // Server Component
* const home = await getSection('home');
*
* // 이후 하위 클라이언트 컴포넌트에서 useSection('home') 사용 가능
*/
declare function InitCms({ sections }: InitCmsProps): null;
export { InitCms, useCmsStore, useSection, useSections };