import { PresentationSlide, SlideElement, SlideBackground } from '../types/presentationTypes';

/** Library item types. */
export type LibraryItemType = 'slide' | 'element' | 'template' | 'theme' | 'animation';
/** Base library item metadata. */
export interface LibraryItemMetadata {
    /** Unique item ID. */
    id: string;
    /** Item type. */
    type: LibraryItemType;
    /** Display name. */
    name: string;
    /** Description. */
    description?: string;
    /** Thumbnail URL. */
    thumbnailUrl?: string;
    /** Tags for search/filter. */
    tags?: string[];
    /** Category/collection IDs. */
    collectionIds?: string[];
    /** Creator information. */
    createdBy: LibraryAuthor;
    /** Creation timestamp. */
    createdAt: string;
    /** Last update timestamp. */
    updatedAt: string;
    /** Version number. */
    version: number;
    /** Usage count. */
    usageCount: number;
    /** Is this a favorite? */
    isFavorite?: boolean;
    /** Visibility: private, team, public. */
    visibility: 'private' | 'team' | 'public';
    /** License information (for public items). */
    license?: string;
}
/** Author information. */
export interface LibraryAuthor {
    id: string;
    name: string;
    email?: string;
    avatarUrl?: string;
    organizationId?: string;
}
/** Slide library item. */
export interface SlideLibraryItem {
    metadata: LibraryItemMetadata;
    /** The slide content. */
    slide: PresentationSlide;
    /** Editable placeholders. */
    placeholders?: SlidePlaceholder[];
    /** Preview images for different themes. */
    themePreviews?: Record<string, string>;
}
/** Element library item. */
export interface ElementLibraryItem {
    metadata: LibraryItemMetadata;
    /** The element content. */
    element: SlideElement;
    /** Supported element types this can replace. */
    compatibleTypes?: string[];
}
/** Template library item (multi-slide). */
export interface TemplateLibraryItem {
    metadata: LibraryItemMetadata;
    /** Template slides. */
    slides: PresentationSlide[];
    /** Template variables. */
    variables?: TemplateVariable[];
    /** Suggested use cases. */
    useCases?: string[];
}
/** Placeholder definition in a slide. */
export interface SlidePlaceholder {
    /** Placeholder ID. */
    id: string;
    /** Element ID containing the placeholder. */
    elementId: string;
    /** Placeholder type. */
    type: 'text' | 'image' | 'chart-data' | 'table-data' | 'color';
    /** Label for UI. */
    label: string;
    /** Default value. */
    defaultValue?: unknown;
    /** Is this required? */
    required?: boolean;
    /** Validation rules. */
    validation?: {
        minLength?: number;
        maxLength?: number;
        pattern?: string;
    };
}
/** Template variable definition. */
export interface TemplateVariable {
    /** Variable name. */
    name: string;
    /** Display label. */
    label: string;
    /** Variable type. */
    type: 'string' | 'number' | 'date' | 'color' | 'image' | 'data';
    /** Default value. */
    defaultValue?: unknown;
    /** Description. */
    description?: string;
    /** Is required? */
    required?: boolean;
}
/** Collection for organizing library items. */
export interface LibraryCollection {
    id: string;
    name: string;
    description?: string;
    icon?: string;
    color?: string;
    parentId?: string;
    itemCount: number;
    createdBy: LibraryAuthor;
    createdAt: string;
    visibility: 'private' | 'team' | 'public';
}
/** Linked slide instance. */
export interface LinkedSlideInstance {
    /** Instance ID (unique per presentation). */
    instanceId: string;
    /** Library item ID this links to. */
    libraryItemId: string;
    /** Presentation ID containing this instance. */
    presentationId: string;
    /** Slide index in presentation. */
    slideIndex: number;
    /** Local overrides. */
    overrides?: SlideOverrides;
    /** Sync status. */
    syncStatus: 'synced' | 'modified' | 'outdated';
    /** Library version when last synced. */
    syncedVersion: number;
}
/** Local overrides for a linked slide. */
export interface SlideOverrides {
    /** Placeholder values. */
    placeholderValues?: Record<string, unknown>;
    /** Element overrides by element ID. */
    elementOverrides?: Record<string, Partial<SlideElement>>;
    /** Background override. */
    backgroundOverride?: SlideBackground;
}
/** Search/filter options. */
export interface LibrarySearchOptions {
    query?: string;
    types?: LibraryItemType[];
    tags?: string[];
    collectionIds?: string[];
    visibility?: ('private' | 'team' | 'public')[];
    createdBy?: string;
    sortBy?: 'name' | 'createdAt' | 'updatedAt' | 'usageCount';
    sortOrder?: 'asc' | 'desc';
    limit?: number;
    offset?: number;
}
/** Search result. */
export interface LibrarySearchResult {
    items: Array<SlideLibraryItem | ElementLibraryItem | TemplateLibraryItem>;
    totalCount: number;
    hasMore: boolean;
}
/**
 * Manages the slide library.
 */
export declare class SlideLibraryManager {
    private slides;
    private elements;
    private templates;
    private collections;
    private linkedInstances;
    private currentUser;
    private onUpdate?;
    constructor(currentUser: LibraryAuthor, onUpdate?: (type: LibraryItemType, itemId: string) => void);
    /**
     * Add a slide to the library.
     */
    addSlide(slide: PresentationSlide, options: {
        name: string;
        description?: string;
        tags?: string[];
        collectionIds?: string[];
        visibility?: 'private' | 'team' | 'public';
        placeholders?: SlidePlaceholder[];
    }): SlideLibraryItem;
    /**
     * Update a slide in the library.
     */
    updateSlide(itemId: string, updates: {
        slide?: PresentationSlide;
        name?: string;
        description?: string;
        tags?: string[];
        placeholders?: SlidePlaceholder[];
    }): SlideLibraryItem | null;
    /**
     * Remove a slide from the library.
     */
    removeSlide(itemId: string): boolean;
    /**
     * Get a slide by ID.
     */
    getSlide(itemId: string): SlideLibraryItem | undefined;
    /**
     * Use a slide from library (creates a copy for insertion).
     */
    useSlide(itemId: string, overrides?: SlideOverrides): PresentationSlide | null;
    /**
     * Create a linked slide instance.
     */
    linkSlide(itemId: string, presentationId: string, slideIndex: number, overrides?: SlideOverrides): LinkedSlideInstance | null;
    /**
     * Sync a linked slide with library.
     */
    syncLinkedSlide(instanceId: string): PresentationSlide | null;
    /**
     * Check if linked slides need sync.
     */
    getOutdatedInstances(): LinkedSlideInstance[];
    /**
     * Add an element to the library.
     */
    addElement(element: SlideElement, options: {
        name: string;
        description?: string;
        tags?: string[];
        visibility?: 'private' | 'team' | 'public';
    }): ElementLibraryItem;
    /**
     * Get an element by ID.
     */
    getElement(itemId: string): ElementLibraryItem | undefined;
    /**
     * Use an element from library.
     */
    useElement(itemId: string): SlideElement | null;
    /**
     * Add a template to the library.
     */
    addTemplate(slides: PresentationSlide[], options: {
        name: string;
        description?: string;
        tags?: string[];
        variables?: TemplateVariable[];
        useCases?: string[];
        visibility?: 'private' | 'team' | 'public';
    }): TemplateLibraryItem;
    /**
     * Get a template by ID.
     */
    getTemplate(itemId: string): TemplateLibraryItem | undefined;
    /**
     * Use a template from library.
     */
    useTemplate(itemId: string, variableValues?: Record<string, unknown>): PresentationSlide[] | null;
    /**
     * Create a collection.
     */
    createCollection(options: {
        name: string;
        description?: string;
        icon?: string;
        color?: string;
        parentId?: string;
        visibility?: 'private' | 'team' | 'public';
    }): LibraryCollection;
    /**
     * Get all collections.
     */
    getCollections(): LibraryCollection[];
    /**
     * Add item to collection.
     */
    addToCollection(itemId: string, collectionId: string): boolean;
    /**
     * Search the library.
     */
    search(options: LibrarySearchOptions): LibrarySearchResult;
    /**
     * Get recent items.
     */
    getRecent(limit?: number): Array<SlideLibraryItem | ElementLibraryItem | TemplateLibraryItem>;
    /**
     * Get favorites.
     */
    getFavorites(): Array<SlideLibraryItem | ElementLibraryItem | TemplateLibraryItem>;
    /**
     * Toggle favorite status.
     */
    toggleFavorite(itemId: string): boolean;
    private generateId;
    private cloneSlide;
    private applyPlaceholderValues;
    private applyTemplateVariables;
    private updateCollectionCounts;
    /**
     * Export library to JSON.
     */
    exportLibrary(): string;
    /**
     * Import library from JSON.
     */
    importLibrary(json: string): void;
}
export default SlideLibraryManager;
//# sourceMappingURL=slideLibrary.d.ts.map