import Piece from './Piece.js'; import type LuzzleStorage from '../storage/abstract.js'; import type { LuzzleDatabase } from '../database/tables/index.js'; import { Readable } from 'stream'; import type { JSONSchemaType } from 'ajv'; import type { PieceFrontmatter } from './utils/frontmatter.js'; export type PiecesPruneResult = { action: 'pruned'; name: string; error?: false; } | { name: string; error: true; message: string; }; export type PiecesSyncResult = { action: 'added' | 'updated' | 'skipped'; name: string; error?: false; } | { name: string; error: true; message: string; }; export interface DiffSummary { added: string[]; updated: string[]; pruned: string[]; } export type SchemaDiff = DiffSummary; export interface PiecesDiff { schemas: DiffSummary; pieces: DiffSummary; } declare class Pieces { private _storage; constructor(storage: LuzzleStorage); getPiece(name: string): Promise>; getPieceMarkdown(file: string, type?: string): Promise>; getPieceAsset(file: string): Promise>; getSchemaPath(name: string): string; getSchema(name: string): Promise>; private getSchemaChange; diffSchemas(db: LuzzleDatabase, options?: { force?: boolean; }): Promise; diff(db: LuzzleDatabase, options?: { force?: boolean; }): Promise; sync(db: LuzzleDatabase, options?: { force?: boolean; }): Promise>; prune(db: LuzzleDatabase): Promise>; parseFilename(file: string): { file: string; type: string | null; format: string; slug: string; }; getSchemas(): Promise; getTypes(): Promise; isAsset(filePath: string): boolean; getFilesIn(dir: string, options?: { deep?: boolean; }): Promise<{ types: string[]; pieces: string[]; assets: string[]; directories: string[]; }>; } export default Pieces;