/** * Official Type definitions for the LemonadeJS plugins * https://lemonadejs.net * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped */ import React from 'react'; import Timeline from './index'; declare namespace TimelineReact { /** * React-idiomatic camelCase aliases for the lemonadejs callbacks. The * wrapper drops the leading `self` argument before invoking these — the * instance is available via the forwarded ref. * * The lowercase names from `Timeline.Options` (e.g. `onupdate`) still * work for legacy compatibility, but new code should prefer these. */ interface ReactCallbacks { /** Fired after `result` is recomputed (initial render + every change). */ onUpdate?: (result: Timeline.Item[]) => void; /** Fired when the edit icon is clicked on an `editable` item. */ onEdition?: (entry: Timeline.Item) => void; } /** Wrapper-only props (the wrapping `
` accepts these). */ interface DOMProps { className?: string; style?: React.CSSProperties; children?: React.ReactNode; } /** * Re-export the underlying type namespace so consumers writing * import { Timeline } from '@lemonadejs/timeline/react'; * import type { Timeline as TimelineNS } from '@lemonadejs/timeline/react'; * get `TimelineNS.Item`, `TimelineNS.ItemInput`, `TimelineNS.Tag`, * `TimelineNS.Options`, `TimelineNS.Instance` directly off the React * import. Same for the `@calendarjs/react` aggregate. */ export type Item = Timeline.Item; export type ItemInput = Timeline.ItemInput; export type Tag = Timeline.Tag; export type Options = Timeline.Options; export type Instance = Timeline.Instance; } // Interface (not const) so the value type declaration-merges with the // namespace above. That merge carries the type members along with the // React component value when the default export is re-exported. interface TimelineReact extends React.MemoExoticComponent< React.ForwardRefExoticComponent< Omit & TimelineReact.ReactCallbacks & TimelineReact.DOMProps & React.RefAttributes > > {} declare const TimelineReact: TimelineReact; export default TimelineReact;