fix(tsc): 0 erreur TypeScript — toutes les 31 erreurs résolues
Types: - NoteType: 'daily' ajouté - PROPERTY_TYPES: 'relation' ajouté - SlashItem: isFavorite? ajouté - SuggestChartsResponse: error? ajouté Fixes propres: - import/route: Date | null → ?? undefined (3 occ) - notes/route: JSON.stringify sur checkItems/labels - user/export: b.title → b.seedIdea, Buffer → Uint8Array - study-plan: language column inexistante → défaut 'fr' - notebooks/[id]: parentId → parent connect/disconnect - brainstorm convert/finalize: async callback - next.config: @ts-expect-error inutile supprimé - ai-settings: revalidateTag(tag, 'default') Casts (TipTap/Prisma, safe at runtime): - tiptap-chart/math extensions: InputRule/options as any - chat/route: system messages as any - note-graph-view: ForceGraph2D as any - property-value-editor: relation comparison - sanitize-content: TrustedHTML cast
This commit is contained in:
@@ -58,10 +58,10 @@ function getCached(key: string): SuggestChartsResponse | null {
|
||||
function setCached(key: string, data: SuggestChartsResponse): void {
|
||||
cache.set(key, { data, timestamp: Date.now() })
|
||||
// Limit cache size to 50 entries
|
||||
if (cache.size > 50) {
|
||||
const firstKey = cache.keys().next().value
|
||||
cache.delete(firstKey)
|
||||
}
|
||||
if (cache.size > 50) {
|
||||
const firstKey = cache.keys().next().value
|
||||
cache.delete(firstKey || '')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ const SVG_SANITIZE_CONFIG = {
|
||||
|
||||
export function sanitizeIllustrationSvg(svg: string): string {
|
||||
if (!svg) return ''
|
||||
return DOMPurify.sanitize(svg, SVG_SANITIZE_CONFIG)
|
||||
return DOMPurify.sanitize(svg, SVG_SANITIZE_CONFIG as any) as unknown as string
|
||||
}
|
||||
|
||||
export function sanitizeRichHtml(html: string): string {
|
||||
|
||||
@@ -5,6 +5,7 @@ export const PROPERTY_TYPES = [
|
||||
'select',
|
||||
'multiselect',
|
||||
'checkbox',
|
||||
'relation',
|
||||
] as const
|
||||
|
||||
export type PropertyType = (typeof PROPERTY_TYPES)[number]
|
||||
|
||||
@@ -48,7 +48,7 @@ export interface LinkMetadata {
|
||||
siteName?: string;
|
||||
}
|
||||
|
||||
export type NoteType = 'text' | 'markdown' | 'richtext' | 'checklist'
|
||||
export type NoteType = 'text' | 'markdown' | 'richtext' | 'checklist' | 'daily'
|
||||
|
||||
export interface Note {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user