@reservi/calendar 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1383 -0
- package/dist/index.js +17977 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1118 -0
- package/dist/themes.css +314 -0
- package/package.json +69 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1383 @@
|
|
|
1
|
+
import { ComponentChildren } from 'preact';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { ReadonlySignal } from '@preact/signals-core';
|
|
6
|
+
import { RefAttributes } from 'react';
|
|
7
|
+
|
|
8
|
+
/** Convierte un `EventDef` del núcleo en el evento que ve el anfitrión. */
|
|
9
|
+
export declare function adaptEvent(def: EventDef): RsvEventApi;
|
|
10
|
+
|
|
11
|
+
/** Vista + rango visible, con fechas nativas. */
|
|
12
|
+
export declare function adaptView(spec: ViewSpec, range?: DateRange, title?: string): RsvViewApi;
|
|
13
|
+
|
|
14
|
+
/** Opciones del calendario menos lo que en React se expresa como props. */
|
|
15
|
+
declare type BaseOptions = Omit<ReserviCalendarOptions, "slots" | "hooks" | "hostBridge">;
|
|
16
|
+
|
|
17
|
+
declare interface BusinessHoursInput {
|
|
18
|
+
/** Días laborables, 0 = domingo … 6 = sábado. */
|
|
19
|
+
daysOfWeek?: number[];
|
|
20
|
+
startTime?: string;
|
|
21
|
+
endTime?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* API pública del calendario y orquestador del dominio. Mantiene el estado en
|
|
26
|
+
* signals (fecha y vista actuales) y deriva el ViewModel bajo demanda.
|
|
27
|
+
*/
|
|
28
|
+
export declare class CalendarApi {
|
|
29
|
+
private readonly dl;
|
|
30
|
+
private readonly registry;
|
|
31
|
+
private readonly store;
|
|
32
|
+
private readonly emitter;
|
|
33
|
+
private readonly options;
|
|
34
|
+
private readonly sources;
|
|
35
|
+
private httpClient;
|
|
36
|
+
private readonly pluginTeardowns;
|
|
37
|
+
private readonly currentDate;
|
|
38
|
+
private readonly viewType;
|
|
39
|
+
private readonly selection;
|
|
40
|
+
private readonly resourceTree;
|
|
41
|
+
private readonly collapsed;
|
|
42
|
+
private readonly _selectedEventIds;
|
|
43
|
+
private disposeEffect;
|
|
44
|
+
/**
|
|
45
|
+
* Versión de las opciones. `getViewModel()` la lee para que `setOption`/
|
|
46
|
+
* `render()` invaliden el `computed` (las opciones son un objeto mutable y
|
|
47
|
+
* los signals no pueden rastrearlo).
|
|
48
|
+
*/
|
|
49
|
+
private readonly optionsVersion;
|
|
50
|
+
private adapter;
|
|
51
|
+
private rootEl;
|
|
52
|
+
/** Profundidad de `batchRendering` (>0 ⇒ se aplazan las invalidaciones). */
|
|
53
|
+
private batchDepth;
|
|
54
|
+
private batchDirty;
|
|
55
|
+
/** Ids de eventos seleccionados (bulk ops). Reactivo: úsalo con `.value` en la UI. */
|
|
56
|
+
readonly selectedEventIds: ReadonlySignal<ReadonlySet<string>>;
|
|
57
|
+
/**
|
|
58
|
+
* ViewModel reactivo: se recalcula solo cuando cambian la fecha, la vista o
|
|
59
|
+
* los eventos. La capa de UI (Preact) lee `.value` y re-renderiza de forma
|
|
60
|
+
* granular.
|
|
61
|
+
*/
|
|
62
|
+
readonly viewModel: ReadonlySignal<ViewModel>;
|
|
63
|
+
constructor(options: CalendarOptions, datePort?: DatePort, http?: HttpPort);
|
|
64
|
+
/** Cliente HTTP perezoso (solo se crea/importa nexa si se usa un feed). */
|
|
65
|
+
private getHttp;
|
|
66
|
+
/** Rango visible actual como argumento de fetch para las fuentes. */
|
|
67
|
+
private fetchArg;
|
|
68
|
+
/** Eventos combinados: array base (`events`/`addEvent`) + fuentes. */
|
|
69
|
+
private allEvents;
|
|
70
|
+
getDate(): RsvDate;
|
|
71
|
+
gotoDate(date: Parameters<DatePort["from"]>[0]): this;
|
|
72
|
+
today(): this;
|
|
73
|
+
private step;
|
|
74
|
+
prev(): this;
|
|
75
|
+
next(): this;
|
|
76
|
+
incrementDate(duration: Duration): this;
|
|
77
|
+
changeView(type: string): this;
|
|
78
|
+
getView(): {
|
|
79
|
+
type: string;
|
|
80
|
+
spec: ViewSpec;
|
|
81
|
+
};
|
|
82
|
+
/** ¿Está registrada esta vista? (para navegación segura, navLinks…). */
|
|
83
|
+
hasView(type: string): boolean;
|
|
84
|
+
private currentSpec;
|
|
85
|
+
addEvent(input: EventInput): EventDef;
|
|
86
|
+
getEventById(id: string): EventDef | undefined;
|
|
87
|
+
getEvents(): EventDef[];
|
|
88
|
+
removeAllEvents(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Re-pide los eventos. Sin argumento, refresca todas las fuentes para el rango
|
|
91
|
+
* visible. Con un array, además reemplaza los eventos base (`events`).
|
|
92
|
+
*/
|
|
93
|
+
refetchEvents(events?: EventInput[]): void;
|
|
94
|
+
/** Registra una fuente (array/función/feed) y la pide para el rango actual. */
|
|
95
|
+
addEventSource(input: EventSourceInput): EventSource_2;
|
|
96
|
+
/** Fuentes registradas (no incluye los `events` base). */
|
|
97
|
+
getEventSources(): EventSource_2[];
|
|
98
|
+
/** Elimina una fuente por id y sus eventos. */
|
|
99
|
+
removeEventSource(id: string): void;
|
|
100
|
+
removeAllEventSources(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Actualiza las fechas de un evento (lo usan drag y resize). Dispara
|
|
103
|
+
* `eventChange`. Devuelve el evento actualizado o undefined si no existe.
|
|
104
|
+
*/
|
|
105
|
+
updateEventDates(id: string, start: RsvDate, end: RsvDate | null): EventDef | undefined;
|
|
106
|
+
/** ¿Puede colocarse el evento en [start, end)? Aplica overlap/constraint/allow. */
|
|
107
|
+
canPlace(id: string, start: RsvDate, end: RsvDate | null): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Mueve/redimensiona un evento validando reglas (overlap/constraint/allow).
|
|
110
|
+
* Devuelve true si se aplicó; false si la colocación no es válida.
|
|
111
|
+
*/
|
|
112
|
+
moveEvent(id: string, start: RsvDate, end: RsvDate | null): boolean;
|
|
113
|
+
select(start: Parameters<DatePort["from"]>[0], end: Parameters<DatePort["from"]>[0]): this;
|
|
114
|
+
unselect(): this;
|
|
115
|
+
getSelection(): Selection_2 | null;
|
|
116
|
+
/** Reemplaza la selección de eventos por este conjunto de ids. */
|
|
117
|
+
selectEvents(ids: string[]): this;
|
|
118
|
+
/** Alterna un evento dentro/fuera de la selección. */
|
|
119
|
+
toggleEventSelection(id: string): this;
|
|
120
|
+
clearEventSelection(): this;
|
|
121
|
+
getSelectedEventIds(): string[];
|
|
122
|
+
/** Elimina un evento por id (y de la selección, si la tenía). */
|
|
123
|
+
removeEvent(id: string): boolean;
|
|
124
|
+
/** Elimina todos los eventos actualmente seleccionados y limpia la selección. */
|
|
125
|
+
removeSelectedEvents(): void;
|
|
126
|
+
/** Filas de recursos aplanadas según el estado de expansión. */
|
|
127
|
+
getResourceRows(): ResourceRow[];
|
|
128
|
+
/** Mueve un evento a otro recurso (drag entre recursos). Dispara `eventChange`. */
|
|
129
|
+
moveEventToResource(id: string, resourceId: string): EventDef | undefined;
|
|
130
|
+
/** Colapsa/expande un recurso (alterna). */
|
|
131
|
+
toggleResource(id: string): this;
|
|
132
|
+
on<K extends keyof CalendarEvents>(name: K, handler: (arg: CalendarEvents[K]) => void): () => void;
|
|
133
|
+
off<K extends keyof CalendarEvents>(name: K, handler: (arg: CalendarEvents[K]) => void): void;
|
|
134
|
+
trigger<K extends keyof CalendarEvents>(name: K, arg: CalendarEvents[K]): void;
|
|
135
|
+
getOption<K extends keyof CalendarOptions>(key: K): CalendarOptions[K];
|
|
136
|
+
setOption<K extends keyof CalendarOptions>(key: K, value: CalendarOptions[K]): this;
|
|
137
|
+
/** Aplica varias opciones de una vez (una sola invalidación y un solo datesSet). */
|
|
138
|
+
setOptions(patch: Partial<CalendarOptions>): this;
|
|
139
|
+
/** Marca el ViewModel como sucio (respeta `batchRendering`). */
|
|
140
|
+
private invalidate;
|
|
141
|
+
/** Fuerza un re-render de la vista (equivalente a `render()` de FullCalendar). */
|
|
142
|
+
render(): this;
|
|
143
|
+
/**
|
|
144
|
+
* Agrupa varias mutaciones en un solo re-render. Compatible con
|
|
145
|
+
* `batchRendering` de FullCalendar.
|
|
146
|
+
*/
|
|
147
|
+
batchRendering(fn: () => void): void;
|
|
148
|
+
/** Instala (o retira, con `null`) el adaptador de vista. */
|
|
149
|
+
setViewAdapter(adapter: CalendarViewAdapter | null): void;
|
|
150
|
+
/** Elemento raíz del calendario, o null si aún no se ha montado. */
|
|
151
|
+
get el(): HTMLElement | null;
|
|
152
|
+
/** Registra el elemento raíz (lo llama la capa de UI al montar). */
|
|
153
|
+
setRootEl(el: HTMLElement | null): void;
|
|
154
|
+
/** Desplaza el cuerpo de la vista hasta esa hora. No-op si la vista no scrollea. */
|
|
155
|
+
scrollToTime(time: string): this;
|
|
156
|
+
/** Hora visible en el borde superior del cuerpo de la vista, o null. */
|
|
157
|
+
getScrollTime(): string | null;
|
|
158
|
+
/** Recalcula medidas del layout. No-op: el layout de Reservi es puro CSS. */
|
|
159
|
+
updateSize(): this;
|
|
160
|
+
/** Opciones globales + overrides de `options.viewOverrides[viewType]` (si hay). */
|
|
161
|
+
private effectiveOptions;
|
|
162
|
+
/** Como `getOption`, pero resuelto con el override de `views` de esa vista. */
|
|
163
|
+
getEffectiveOption<K extends keyof CalendarOptions>(key: K, viewType?: string): CalendarOptions[K];
|
|
164
|
+
getViewModel(): ViewModel;
|
|
165
|
+
/** "Ahora" del calendario: la opción `now` si se dio, si no el reloj real. */
|
|
166
|
+
private nowDate;
|
|
167
|
+
/** Primer día de la semana efectivo: opción explícita o el del locale. */
|
|
168
|
+
private firstDay;
|
|
169
|
+
/** Construye un Date UTC a partir de los componentes (independiente del host). */
|
|
170
|
+
private toUtc;
|
|
171
|
+
/** Título de la toolbar, localizado vía Intl (en UTC para ser determinista). */
|
|
172
|
+
private formatTitle;
|
|
173
|
+
private emitDatesSet;
|
|
174
|
+
/** Libera recursos (efectos de signals). */
|
|
175
|
+
destroy(): void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Mapa de eventos emitibles (crece por fase). */
|
|
179
|
+
declare interface CalendarEvents extends Record<string, unknown> {
|
|
180
|
+
datesSet: {
|
|
181
|
+
range: DateRange;
|
|
182
|
+
view: ViewSpec;
|
|
183
|
+
};
|
|
184
|
+
eventsSet: EventDef[];
|
|
185
|
+
eventClick: {
|
|
186
|
+
event: EventDef;
|
|
187
|
+
el?: HTMLElement;
|
|
188
|
+
};
|
|
189
|
+
/** `allDay` distingue el clic en la franja de todo el día del clic en un slot. */
|
|
190
|
+
dateClick: {
|
|
191
|
+
date: RsvDate;
|
|
192
|
+
allDay?: boolean;
|
|
193
|
+
};
|
|
194
|
+
eventChange: {
|
|
195
|
+
event: EventDef;
|
|
196
|
+
};
|
|
197
|
+
eventDrop: {
|
|
198
|
+
event: EventDef;
|
|
199
|
+
};
|
|
200
|
+
eventResize: {
|
|
201
|
+
event: EventDef;
|
|
202
|
+
};
|
|
203
|
+
select: {
|
|
204
|
+
start: RsvDate;
|
|
205
|
+
end: RsvDate;
|
|
206
|
+
};
|
|
207
|
+
unselect: Record<string, never>;
|
|
208
|
+
navLinkDay: {
|
|
209
|
+
date: RsvDate;
|
|
210
|
+
};
|
|
211
|
+
moreLinkClick: {
|
|
212
|
+
date: RsvDate;
|
|
213
|
+
allEvents: EventDef[];
|
|
214
|
+
hiddenEvents: EventDef[];
|
|
215
|
+
};
|
|
216
|
+
loading: {
|
|
217
|
+
isLoading: boolean;
|
|
218
|
+
};
|
|
219
|
+
eventSelectionChange: {
|
|
220
|
+
ids: string[];
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Opciones de calendario (subconjunto de Fase 1; crece por fase). */
|
|
225
|
+
export declare interface CalendarOptions {
|
|
226
|
+
/** Vista inicial, p. ej. "dayGridMonth". */
|
|
227
|
+
initialView: string;
|
|
228
|
+
/** Fecha inicial (por defecto: hoy). */
|
|
229
|
+
initialDate?: DateLike;
|
|
230
|
+
/** Sobreescribe "ahora" (útil para tests y demos deterministas). */
|
|
231
|
+
now?: DateLike;
|
|
232
|
+
/** Plugins que aportan vistas/comportamientos. */
|
|
233
|
+
plugins?: PluginDef[];
|
|
234
|
+
/** Eventos iniciales (array). */
|
|
235
|
+
events?: EventInput[];
|
|
236
|
+
/**
|
|
237
|
+
* Fuentes de eventos adicionales: arrays, funciones `(rango)=>eventos|Promise`
|
|
238
|
+
* o feeds JSON remotos (vía nexa). Se combinan con `events`.
|
|
239
|
+
*/
|
|
240
|
+
eventSources?: EventSourceInput[];
|
|
241
|
+
/**
|
|
242
|
+
* Re-pedir las fuentes dinámicas (función/feed) al cambiar el rango visible
|
|
243
|
+
* (def. true). Las fuentes de array nunca se re-piden.
|
|
244
|
+
*/
|
|
245
|
+
lazyFetching?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Transforma cada evento (de `events` y de las fuentes) antes de normalizarlo.
|
|
248
|
+
* Útil para remapear payloads remotos al formato de evento.
|
|
249
|
+
*/
|
|
250
|
+
eventDataTransform?: (input: EventInput) => EventInput;
|
|
251
|
+
/** Recursos (Scheduler): jerarquía por `children` o `parentId`. */
|
|
252
|
+
resources?: ResourceInput[];
|
|
253
|
+
/** Recursos inicialmente expandidos (def. true). */
|
|
254
|
+
resourcesInitiallyExpanded?: boolean;
|
|
255
|
+
/** Orden de recursos por campo ("title", "id" o "-title" para descendente). */
|
|
256
|
+
resourceOrder?: string;
|
|
257
|
+
/** Ancho del área de recursos en las vistas de recurso (def. "30%"). */
|
|
258
|
+
resourceAreaWidth?: string;
|
|
259
|
+
/** Primer día de la semana: 0 = domingo (def.) … 6 = sábado. */
|
|
260
|
+
firstDay?: number;
|
|
261
|
+
/** Mostrar fin de semana (def. true). Equivale a hiddenDays=[0,6] si es false. */
|
|
262
|
+
weekends?: boolean;
|
|
263
|
+
/** Días a ocultar (0=domingo…6=sábado). Tiene prioridad sobre weekends. */
|
|
264
|
+
hiddenDays?: number[];
|
|
265
|
+
/** Mes: forzar 6 semanas siempre (def. false). */
|
|
266
|
+
fixedWeekCount?: boolean;
|
|
267
|
+
/** Mes: mostrar días de meses adyacentes (def. true). */
|
|
268
|
+
showNonCurrentDates?: boolean;
|
|
269
|
+
/** Mostrar la columna de número de semana (def. false). */
|
|
270
|
+
weekNumbers?: boolean;
|
|
271
|
+
/** Cálculo del número de semana: "local" (def.) o "ISO". */
|
|
272
|
+
weekNumberCalculation?: "local" | "ISO";
|
|
273
|
+
/** Hace clic-navegables los números/cabeceras de día (van a la vista de día). */
|
|
274
|
+
navLinks?: boolean;
|
|
275
|
+
/** Máximo de eventos por celda antes del enlace "+N more". */
|
|
276
|
+
dayMaxEvents?: number | boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Alias de `dayMaxEvents` por compatibilidad con FullCalendar. Si se indica
|
|
279
|
+
* y `dayMaxEvents` no, se usa este valor.
|
|
280
|
+
*/
|
|
281
|
+
dayMaxEventRows?: number | boolean;
|
|
282
|
+
/** Hora mínima visible (def. "00:00"). */
|
|
283
|
+
slotMinTime?: string;
|
|
284
|
+
/** Hora máxima visible (def. "24:00"). */
|
|
285
|
+
slotMaxTime?: string;
|
|
286
|
+
/** Altura temporal de cada slot, "HH:mm" (def. "00:30"). */
|
|
287
|
+
slotDuration?: string;
|
|
288
|
+
/** Cada cuánto se etiqueta el eje, "HH:mm" (def. "01:00"). */
|
|
289
|
+
slotLabelInterval?: string;
|
|
290
|
+
/** Mostrar la franja de todo el día (def. true). */
|
|
291
|
+
allDaySlot?: boolean;
|
|
292
|
+
/** Mostrar el indicador de "ahora" (def. true). */
|
|
293
|
+
nowIndicator?: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Hora a la que se desplaza el scroll del cuerpo de timeGrid al montar la
|
|
296
|
+
* vista y al cambiar de vista/fecha, "HH:mm" o "HH:mm:ss" (def. "06:00").
|
|
297
|
+
*/
|
|
298
|
+
scrollTime?: string;
|
|
299
|
+
/** Permite arrastrar/redimensionar eventos (def. false). */
|
|
300
|
+
editable?: boolean;
|
|
301
|
+
/** Permite seleccionar rangos por arrastre (def. false). */
|
|
302
|
+
selectable?: boolean;
|
|
303
|
+
/** Dibuja un "fantasma" del rango mientras se arrastra la selección (def. false). */
|
|
304
|
+
selectMirror?: boolean;
|
|
305
|
+
/** Resolución de ajuste al arrastrar, "HH:mm" (def. "00:15"). */
|
|
306
|
+
snapDuration?: string;
|
|
307
|
+
/** Horas laborables (sombreado y posible constraint). */
|
|
308
|
+
businessHours?: boolean | BusinessHoursInput;
|
|
309
|
+
/** Permitir solapamiento de eventos al mover/redimensionar (def. true). */
|
|
310
|
+
eventOverlap?: boolean;
|
|
311
|
+
/** Restringe eventos a las horas laborables. */
|
|
312
|
+
eventConstraint?: "businessHours";
|
|
313
|
+
/** Veto programático al mover/redimensionar un evento. */
|
|
314
|
+
eventAllow?: (info: EventAllowInfo) => boolean;
|
|
315
|
+
/** Nombre de un theme pre-hecho (se aplica como data-rsv-theme en el root). */
|
|
316
|
+
theme?: string;
|
|
317
|
+
/** Tokens de theme personalizados (se aplican inline como variables CSS). */
|
|
318
|
+
themeTokens?: Partial<ReserviThemeTokens>;
|
|
319
|
+
locale?: string;
|
|
320
|
+
/** Dirección del texto; por defecto se deriva del locale. */
|
|
321
|
+
direction?: "ltr" | "rtl";
|
|
322
|
+
/** Zona horaria: "local" (def.), "UTC" o IANA. */
|
|
323
|
+
timeZone?: string;
|
|
324
|
+
headerToolbar?: ToolbarOptions | false;
|
|
325
|
+
/** Alto de cada slot horario en px (mapea a la variable de theme `slotHeight`). */
|
|
326
|
+
hourHeight?: number;
|
|
327
|
+
/**
|
|
328
|
+
* Alto del contenedor raíz: número de px, cualquier longitud CSS o "auto"
|
|
329
|
+
* (el calendario crece con su contenido). Por defecto no se fija alto.
|
|
330
|
+
*/
|
|
331
|
+
height?: number | string;
|
|
332
|
+
/** Formato de la hora mostrada en los eventos (def. 24h "HH:mm"). */
|
|
333
|
+
eventTimeFormat?: Intl.DateTimeFormatOptions;
|
|
334
|
+
/** Formato de las etiquetas del eje horario de timeGrid (def. 24h "HH:mm"). */
|
|
335
|
+
slotLabelFormat?: Intl.DateTimeFormatOptions;
|
|
336
|
+
/** Formato de la cabecera de día; `false` oculta el texto por defecto. */
|
|
337
|
+
dayHeaderFormat?: Intl.DateTimeFormatOptions | false;
|
|
338
|
+
/** Formato de la cabecera de día de la vista lista. */
|
|
339
|
+
listDayFormat?: Intl.DateTimeFormatOptions | false;
|
|
340
|
+
/** Formato del texto secundario de la cabecera de día de la vista lista. */
|
|
341
|
+
listDaySideFormat?: Intl.DateTimeFormatOptions | false;
|
|
342
|
+
/**
|
|
343
|
+
* Formato del título de la toolbar: opciones de `Intl.DateTimeFormat`, o una
|
|
344
|
+
* función que recibe el rango visible y devuelve el título ya formateado.
|
|
345
|
+
*/
|
|
346
|
+
titleFormat?: Intl.DateTimeFormatOptions | ((range: DateRange) => string);
|
|
347
|
+
/**
|
|
348
|
+
* Overrides de cualquier opción anterior, por tipo de vista (p. ej.
|
|
349
|
+
* `{ timeGridDay: { slotDuration: "00:15" } }`). Se mergean sobre las
|
|
350
|
+
* opciones globales solo mientras esa vista está activa.
|
|
351
|
+
*/
|
|
352
|
+
viewOverrides?: Record<string, Partial<CalendarOptions>>;
|
|
353
|
+
/**
|
|
354
|
+
* Atajos de teclado configurables para navegar/activar un evento enfocado
|
|
355
|
+
* (por defecto: flechas para mover, Enter/espacio para activar).
|
|
356
|
+
*/
|
|
357
|
+
keyboardShortcuts?: Partial<Record<KeyboardAction, string[]>>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Adaptador que instala la capa de UI para las operaciones que necesitan DOM
|
|
362
|
+
* (scroll, medidas). El núcleo sigue siendo agnóstico: si no hay adaptador
|
|
363
|
+
* instalado, estas operaciones son no-ops seguras.
|
|
364
|
+
*/
|
|
365
|
+
export declare interface CalendarViewAdapter {
|
|
366
|
+
/** Desplaza el cuerpo de la vista hasta esa hora ("HH:mm" / "HH:mm:ss"). */
|
|
367
|
+
scrollToTime?(time: string): void;
|
|
368
|
+
/** Hora ("HH:mm:ss") en el borde superior del área visible, o null. */
|
|
369
|
+
getScrollTime?(): string | null;
|
|
370
|
+
/** Fuerza un recálculo de medidas del layout. */
|
|
371
|
+
updateSize?(): void;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export declare interface DateClickArg {
|
|
375
|
+
date: Date;
|
|
376
|
+
dateStr: string;
|
|
377
|
+
allDay: boolean;
|
|
378
|
+
view: RsvViewApi;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
declare type DateLike = string | number | Date;
|
|
382
|
+
|
|
383
|
+
declare interface DatePort {
|
|
384
|
+
/** Crea una fecha a partir de ISO string, epoch ms o Date nativo. */
|
|
385
|
+
from(input: DateLike): RsvDate;
|
|
386
|
+
/** Instante actual. */
|
|
387
|
+
now(): RsvDate;
|
|
388
|
+
add(date: RsvDate, duration: Duration): RsvDate;
|
|
389
|
+
subtract(date: RsvDate, duration: Duration): RsvDate;
|
|
390
|
+
startOf(date: RsvDate, unit: DateUnit): RsvDate;
|
|
391
|
+
endOf(date: RsvDate, unit: DateUnit): RsvDate;
|
|
392
|
+
/** Día de la semana, 0 = domingo … 6 = sábado (convención FullCalendar). */
|
|
393
|
+
dayOfWeek(date: RsvDate): number;
|
|
394
|
+
/** Año (p. ej. 2026). */
|
|
395
|
+
year(date: RsvDate): number;
|
|
396
|
+
/** Mes 1–12. */
|
|
397
|
+
month(date: RsvDate): number;
|
|
398
|
+
/** Día del mes 1–31. */
|
|
399
|
+
dayOfMonth(date: RsvDate): number;
|
|
400
|
+
/** Hora 0–23. */
|
|
401
|
+
hour(date: RsvDate): number;
|
|
402
|
+
/** Minuto 0–59. */
|
|
403
|
+
minute(date: RsvDate): number;
|
|
404
|
+
isBefore(a: RsvDate, b: RsvDate): boolean;
|
|
405
|
+
isAfter(a: RsvDate, b: RsvDate): boolean;
|
|
406
|
+
isSame(a: RsvDate, b: RsvDate, unit?: DateUnit): boolean;
|
|
407
|
+
/** ¿Mismo día natural? Compara año/mes/día (robusto frente a zona horaria). */
|
|
408
|
+
isSameDay(a: RsvDate, b: RsvDate): boolean;
|
|
409
|
+
/** ¿`date` está en [start, end)? */
|
|
410
|
+
isBetween(date: RsvDate, start: RsvDate, end: RsvDate): boolean;
|
|
411
|
+
/** Diferencia entera de `b - a` en la unidad dada. */
|
|
412
|
+
diff(a: RsvDate, b: RsvDate, unit: DateUnit): number;
|
|
413
|
+
range(start: RsvDate, end: RsvDate): RsvRange;
|
|
414
|
+
/** Lista de días (inicio de cada día) que solapan el rango [start, end). */
|
|
415
|
+
eachDayOfRange(start: RsvDate, end: RsvDate): RsvDate[];
|
|
416
|
+
format(date: RsvDate, pattern: string): string;
|
|
417
|
+
locale(date: RsvDate, locale: string): RsvDate;
|
|
418
|
+
timezone(date: RsvDate, timeZone: string): RsvDate;
|
|
419
|
+
toISOString(date: RsvDate): string;
|
|
420
|
+
toDate(date: RsvDate): Date;
|
|
421
|
+
valueOf(date: RsvDate): number;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** Rango de fechas calculado para la vista actual. */
|
|
425
|
+
declare interface DateRange {
|
|
426
|
+
/** Inicio del rango visible (puede incluir días de meses adyacentes). */
|
|
427
|
+
readonly activeStart: RsvDate;
|
|
428
|
+
/** Fin (exclusivo) del rango visible. */
|
|
429
|
+
readonly activeEnd: RsvDate;
|
|
430
|
+
/** Inicio del periodo "actual" (p. ej. el día 1 del mes). */
|
|
431
|
+
readonly currentStart: RsvDate;
|
|
432
|
+
/** Fin (exclusivo) del periodo actual. */
|
|
433
|
+
readonly currentEnd: RsvDate;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export declare interface DatesSetArg {
|
|
437
|
+
start: Date;
|
|
438
|
+
end: Date;
|
|
439
|
+
startStr: string;
|
|
440
|
+
endStr: string;
|
|
441
|
+
view: RsvViewApi;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* DatePort — puerto de salida del dominio para TODA la lógica de fechas.
|
|
446
|
+
*
|
|
447
|
+
* El dominio depende SOLO de esta interfaz (DIP). La implementación concreta
|
|
448
|
+
* vive en `core/datelib` (adaptador sobre @bereasoftware/time-guard). Esto
|
|
449
|
+
* permite inyectar un fake determinista en los tests y aísla la dependencia
|
|
450
|
+
* de la librería de fechas en un único punto (ver STRUCTURE.md §3b).
|
|
451
|
+
*/
|
|
452
|
+
/** Unidad de tiempo para startOf/endOf/diff. */
|
|
453
|
+
declare type DateUnit = "year" | "month" | "week" | "day" | "hour" | "minute" | "second";
|
|
454
|
+
|
|
455
|
+
/** Argumento del slot de celda de día. */
|
|
456
|
+
declare interface DayCellContentArg {
|
|
457
|
+
date: Date;
|
|
458
|
+
dayNumber: number;
|
|
459
|
+
isToday: boolean;
|
|
460
|
+
isOther: boolean;
|
|
461
|
+
view: ViewArg;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
declare interface DayGridCell {
|
|
465
|
+
readonly date: RsvDate;
|
|
466
|
+
readonly dayOfWeek: number;
|
|
467
|
+
readonly isToday: boolean;
|
|
468
|
+
readonly isWeekend: boolean;
|
|
469
|
+
/** No pertenece al mes "actual" (días de relleno). */
|
|
470
|
+
readonly isOther: boolean;
|
|
471
|
+
/** Día laborable (según businessHours). */
|
|
472
|
+
readonly isBusiness: boolean;
|
|
473
|
+
/** Día dentro de la selección activa. */
|
|
474
|
+
readonly isSelected: boolean;
|
|
475
|
+
/** Eventos visibles ese día (ya recortados por dayMaxEvents). */
|
|
476
|
+
readonly events: EventDef[];
|
|
477
|
+
/** Eventos ocultos por el límite (los que cuentan para "+N more"). */
|
|
478
|
+
readonly hiddenEvents: EventDef[];
|
|
479
|
+
/** Eventos ocultos por el límite ("+N more"). */
|
|
480
|
+
readonly moreCount: number;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
declare interface DayGridModel {
|
|
484
|
+
readonly weeks: DayGridWeek[];
|
|
485
|
+
/** Columnas visibles por semana (7 menos los días ocultos). */
|
|
486
|
+
readonly columnCount: number;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Plugin DayGrid: registra las vistas de cuadrícula por días. Solo aporta las
|
|
491
|
+
* especificaciones de vista (datos puros); el renderizado vive en @reservi/preact.
|
|
492
|
+
*/
|
|
493
|
+
export declare const dayGridPlugin: PluginDef;
|
|
494
|
+
|
|
495
|
+
declare interface DayGridWeek {
|
|
496
|
+
readonly days: DayGridCell[];
|
|
497
|
+
/** Número de semana (solo si `weekNumbers` está activo). */
|
|
498
|
+
readonly weekNumber?: number;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/** Argumento del slot de cabecera de día (nombre del día de la semana). */
|
|
502
|
+
declare interface DayHeaderContentArg {
|
|
503
|
+
date: Date;
|
|
504
|
+
text: string;
|
|
505
|
+
/** Día de la semana, 0 = domingo … 6 = sábado. */
|
|
506
|
+
dayOfWeek: number;
|
|
507
|
+
/** Día del mes (1–31). */
|
|
508
|
+
dayNumber: number;
|
|
509
|
+
isToday: boolean;
|
|
510
|
+
view: ViewArg;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/** Helper identidad con tipado, para declarar plugins de forma ergonómica. */
|
|
514
|
+
export declare function definePlugin(def: PluginDef): PluginDef;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Helper para definir un theme tipado y reutilizable.
|
|
518
|
+
* @example const midnight = defineTheme({ bg: "#0b1020", primary: "#7c5cff" })
|
|
519
|
+
*/
|
|
520
|
+
export declare function defineTheme(tokens: Partial<ReserviThemeTokens>): Partial<ReserviThemeTokens>;
|
|
521
|
+
|
|
522
|
+
/** Implementación de fechas activa por defecto (time-guard). */
|
|
523
|
+
export declare const dl: DatePort;
|
|
524
|
+
|
|
525
|
+
/** Duración relativa (los campos ausentes valen 0). */
|
|
526
|
+
declare interface Duration {
|
|
527
|
+
years?: number;
|
|
528
|
+
months?: number;
|
|
529
|
+
weeks?: number;
|
|
530
|
+
days?: number;
|
|
531
|
+
hours?: number;
|
|
532
|
+
minutes?: number;
|
|
533
|
+
seconds?: number;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/** Info que recibe el callback `eventAllow` al arrastrar/redimensionar. */
|
|
537
|
+
declare interface EventAllowInfo {
|
|
538
|
+
start: RsvDate;
|
|
539
|
+
end: RsvDate | null;
|
|
540
|
+
event: EventDef;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export declare interface EventChangeArg {
|
|
544
|
+
event: RsvEventApi;
|
|
545
|
+
view: RsvViewApi;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export declare interface EventClickArg {
|
|
549
|
+
event: RsvEventApi;
|
|
550
|
+
el: HTMLElement | null;
|
|
551
|
+
view: RsvViewApi;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/** Argumento del slot de contenido de evento. */
|
|
555
|
+
declare interface EventContentArg {
|
|
556
|
+
event: EventDef;
|
|
557
|
+
isAllDay: boolean;
|
|
558
|
+
/** Texto de hora ya formateado (vacío si allDay). */
|
|
559
|
+
timeText: string;
|
|
560
|
+
view: ViewArg;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Evento normalizado del dominio: fechas ya parseadas a RsvDate, colores
|
|
565
|
+
* resueltos y propiedades no estándar movidas a extendedProps.
|
|
566
|
+
*/
|
|
567
|
+
export declare interface EventDef {
|
|
568
|
+
readonly id: string;
|
|
569
|
+
readonly groupId: string;
|
|
570
|
+
readonly title: string;
|
|
571
|
+
readonly start: RsvDate;
|
|
572
|
+
readonly end: RsvDate | null;
|
|
573
|
+
readonly allDay: boolean;
|
|
574
|
+
readonly url: string;
|
|
575
|
+
readonly display: EventDisplay;
|
|
576
|
+
readonly editable: boolean | null;
|
|
577
|
+
readonly backgroundColor: string;
|
|
578
|
+
readonly borderColor: string;
|
|
579
|
+
readonly textColor: string;
|
|
580
|
+
readonly classNames: string[];
|
|
581
|
+
readonly resourceIds: string[];
|
|
582
|
+
/** Definición de recurrencia, o null si es un evento único. */
|
|
583
|
+
readonly recurrence: RecurrenceDef | null;
|
|
584
|
+
readonly extendedProps: Record<string, unknown>;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** Cómo se pinta un evento (compatible con FullCalendar). */
|
|
588
|
+
declare type EventDisplay = "auto" | "block" | "list-item" | "background" | "inverse-background" | "none";
|
|
589
|
+
|
|
590
|
+
/** Info que recibe una fuente de eventos al pedirle el rango visible. */
|
|
591
|
+
declare interface EventFetchArg {
|
|
592
|
+
start: RsvDate;
|
|
593
|
+
end: RsvDate;
|
|
594
|
+
/** Inicio del rango en ISO (para `startParam` de feeds). */
|
|
595
|
+
startStr: string;
|
|
596
|
+
/** Fin (exclusivo) del rango en ISO. */
|
|
597
|
+
endStr: string;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** Entrada de evento tal como la da el usuario. */
|
|
601
|
+
export declare interface EventInput {
|
|
602
|
+
id?: string;
|
|
603
|
+
groupId?: string;
|
|
604
|
+
title?: string;
|
|
605
|
+
start: DateLike;
|
|
606
|
+
end?: DateLike;
|
|
607
|
+
allDay?: boolean;
|
|
608
|
+
url?: string;
|
|
609
|
+
editable?: boolean;
|
|
610
|
+
startEditable?: boolean;
|
|
611
|
+
durationEditable?: boolean;
|
|
612
|
+
display?: EventDisplay;
|
|
613
|
+
color?: string;
|
|
614
|
+
backgroundColor?: string;
|
|
615
|
+
borderColor?: string;
|
|
616
|
+
textColor?: string;
|
|
617
|
+
classNames?: string | string[];
|
|
618
|
+
/** Recursos (Scheduler). */
|
|
619
|
+
resourceId?: string;
|
|
620
|
+
resourceIds?: string[];
|
|
621
|
+
/** Días de la semana en que se repite, 0 = domingo … 6 = sábado. */
|
|
622
|
+
daysOfWeek?: number[];
|
|
623
|
+
/** Hora de inicio de cada repetición, "HH:mm". */
|
|
624
|
+
startTime?: string;
|
|
625
|
+
/** Hora de fin de cada repetición, "HH:mm". */
|
|
626
|
+
endTime?: string;
|
|
627
|
+
/** Primer día de la recurrencia. */
|
|
628
|
+
startRecur?: DateLike;
|
|
629
|
+
/** Último día (exclusivo) de la recurrencia. */
|
|
630
|
+
endRecur?: DateLike;
|
|
631
|
+
/** Duración de cada instancia, "HH:mm" (alternativa a end/endTime). */
|
|
632
|
+
duration?: string;
|
|
633
|
+
/** Regla RRULE (RFC 5545) como cadena, p. ej. "FREQ=WEEKLY;BYDAY=MO,WE". */
|
|
634
|
+
rrule?: string;
|
|
635
|
+
/** Fechas excluidas (ISO) de la recurrencia. */
|
|
636
|
+
exdate?: string[];
|
|
637
|
+
/** Cualquier clave no estándar acaba aquí. */
|
|
638
|
+
extendedProps?: Record<string, unknown>;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/** Handle público de una fuente registrada. */
|
|
642
|
+
declare interface EventSource_2 {
|
|
643
|
+
readonly id: string;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/** Fuente como función: recibe el rango y devuelve eventos (sync o async). */
|
|
647
|
+
declare type EventSourceFunc = (arg: EventFetchArg) => EventInput[] | Promise<EventInput[]>;
|
|
648
|
+
|
|
649
|
+
/** Toda forma admisible de fuente de eventos. */
|
|
650
|
+
declare type EventSourceInput = EventInput[] | EventSourceFunc | JsonFeedSource | EventSourceObject;
|
|
651
|
+
|
|
652
|
+
/** Objeto fuente: envuelve cualquier tipo y añade `id`/`color` por defecto. */
|
|
653
|
+
declare interface EventSourceObject {
|
|
654
|
+
id?: string;
|
|
655
|
+
events: EventInput[] | EventSourceFunc | JsonFeedSource;
|
|
656
|
+
color?: string;
|
|
657
|
+
/** Cachea la respuesta por rango durante `ttl` ms (aplica a `events` función o feed). */
|
|
658
|
+
ttl?: number;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Puente para pintar contenido del framework anfitrión dentro del árbol de
|
|
663
|
+
* Preact. Lo implementan los wrappers (p. ej. `@reservi/react` con portales).
|
|
664
|
+
*/
|
|
665
|
+
declare interface HostBridge {
|
|
666
|
+
/** Un hueco ha entrado en el DOM: pinta `node` dentro de `el`. */
|
|
667
|
+
mount(id: string, el: HTMLElement, node: unknown): void;
|
|
668
|
+
/** El contenido del hueco `id` ha cambiado. */
|
|
669
|
+
update(id: string, node: unknown): void;
|
|
670
|
+
/** El hueco `id` ha salido del DOM: libera lo que se pintó en él. */
|
|
671
|
+
unmount(id: string): void;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Marcador que puede devolver un slot cuando el contenido lo pinta el
|
|
676
|
+
* framework anfitrión (React, Vue…). La capa Preact NO interpreta `node`:
|
|
677
|
+
* solo reserva un hueco en el DOM y delega en el `hostBridge`.
|
|
678
|
+
*/
|
|
679
|
+
declare interface HostSlotResult {
|
|
680
|
+
readonly __rsvHost: true;
|
|
681
|
+
/** Nodo del framework anfitrión (opaco para esta capa). */
|
|
682
|
+
readonly node: unknown;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
declare interface HttpError {
|
|
686
|
+
readonly code: string;
|
|
687
|
+
readonly message: string;
|
|
688
|
+
readonly status?: number;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
declare interface HttpPort {
|
|
692
|
+
get<T>(url: string, config?: HttpRequestConfig): Promise<HttpResult<T>>;
|
|
693
|
+
post<T>(url: string, data?: unknown, config?: HttpRequestConfig): Promise<HttpResult<T>>;
|
|
694
|
+
put<T>(url: string, data?: unknown, config?: HttpRequestConfig): Promise<HttpResult<T>>;
|
|
695
|
+
patch<T>(url: string, data?: unknown, config?: HttpRequestConfig): Promise<HttpResult<T>>;
|
|
696
|
+
delete<T>(url: string, config?: HttpRequestConfig): Promise<HttpResult<T>>;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
declare interface HttpRequestConfig {
|
|
700
|
+
/** Parámetros de query string. */
|
|
701
|
+
query?: Record<string, unknown>;
|
|
702
|
+
/** Parámetros de ruta (`/users/:id`). */
|
|
703
|
+
params?: Record<string, string | number>;
|
|
704
|
+
headers?: Record<string, string>;
|
|
705
|
+
/** Timeout en ms. */
|
|
706
|
+
timeout?: number;
|
|
707
|
+
/** Caché por petición. */
|
|
708
|
+
cache?: {
|
|
709
|
+
enabled: boolean;
|
|
710
|
+
ttlMs: number;
|
|
711
|
+
};
|
|
712
|
+
/** Reintentos por petición. */
|
|
713
|
+
retry?: {
|
|
714
|
+
maxAttempts: number;
|
|
715
|
+
backoffMs: number;
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* HttpPort — puerto de salida del dominio para TODA la I/O HTTP.
|
|
721
|
+
*
|
|
722
|
+
* El dominio (y las fuentes de eventos remotas) dependen solo de esta interfaz.
|
|
723
|
+
* La implementación concreta vive en `core/http` (adaptador sobre
|
|
724
|
+
* @bereasoftware/nexa). Conserva el patrón Result monad de nexa: nada de
|
|
725
|
+
* excepciones para errores HTTP esperados.
|
|
726
|
+
*/
|
|
727
|
+
declare interface HttpResponse<T> {
|
|
728
|
+
readonly data: T;
|
|
729
|
+
readonly status: number;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/** Result monad: éxito tipado o error tipado, nunca ambos. */
|
|
733
|
+
declare type HttpResult<T> = {
|
|
734
|
+
readonly ok: true;
|
|
735
|
+
readonly value: HttpResponse<T>;
|
|
736
|
+
} | {
|
|
737
|
+
readonly ok: false;
|
|
738
|
+
readonly error: HttpError;
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
/** Fuente como feed remoto (toda la I/O HTTP pasa por la fachada nexa). */
|
|
742
|
+
declare interface JsonFeedSource {
|
|
743
|
+
id?: string;
|
|
744
|
+
url: string;
|
|
745
|
+
/** "json" (def.) espera un array de eventos; "ics" parsea iCalendar. */
|
|
746
|
+
format?: "json" | "ics";
|
|
747
|
+
method?: "GET" | "POST";
|
|
748
|
+
/** Parámetros extra fijos o calculados en cada fetch. */
|
|
749
|
+
extraParams?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
750
|
+
/** Nombre del query param para el inicio del rango (def. "start"). */
|
|
751
|
+
startParam?: string;
|
|
752
|
+
/** Nombre del query param para el fin del rango (def. "end"). */
|
|
753
|
+
endParam?: string;
|
|
754
|
+
headers?: Record<string, string>;
|
|
755
|
+
/** Color por defecto aplicado a los eventos sin color propio. */
|
|
756
|
+
color?: string;
|
|
757
|
+
/** Cachea la respuesta por rango durante `ttl` ms (sin cache si se omite). */
|
|
758
|
+
ttl?: number;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/** Acciones de teclado configurables sobre un evento enfocado. */
|
|
762
|
+
declare type KeyboardAction = "moveLeft" | "moveRight" | "moveUp" | "moveDown" | "activate";
|
|
763
|
+
|
|
764
|
+
declare interface ListDay {
|
|
765
|
+
readonly date: RsvDate;
|
|
766
|
+
readonly isToday: boolean;
|
|
767
|
+
readonly events: EventDef[];
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
declare interface ListModel {
|
|
771
|
+
/** Solo días con eventos (como FullCalendar list). */
|
|
772
|
+
readonly days: ListDay[];
|
|
773
|
+
readonly isEmpty: boolean;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/** Plugin List: vistas de agenda en lista. */
|
|
777
|
+
export declare const listPlugin: PluginDef;
|
|
778
|
+
|
|
779
|
+
export declare interface MoreLinkClickArg {
|
|
780
|
+
date: Date;
|
|
781
|
+
dateStr: string;
|
|
782
|
+
allEvents: RsvEventApi[];
|
|
783
|
+
hiddenEvents: RsvEventApi[];
|
|
784
|
+
view: RsvViewApi;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/** Argumento del slot del botón "+N more" (popover de eventos ocultos). */
|
|
788
|
+
declare interface MoreLinkContentArg {
|
|
789
|
+
date: Date;
|
|
790
|
+
moreCount: number;
|
|
791
|
+
allEvents: EventDef[];
|
|
792
|
+
hiddenEvents: EventDef[];
|
|
793
|
+
view: ViewArg;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
declare interface MultiMonthEntry {
|
|
797
|
+
readonly date: RsvDate;
|
|
798
|
+
readonly dayGrid: DayGridModel;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
declare interface MultiMonthModel {
|
|
802
|
+
readonly months: MultiMonthEntry[];
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
/** Plugin MultiMonth: rejilla de varios meses (vista de año). */
|
|
806
|
+
export declare const multiMonthPlugin: PluginDef;
|
|
807
|
+
|
|
808
|
+
declare interface NowIndicator {
|
|
809
|
+
readonly dayIndex: number;
|
|
810
|
+
readonly topPct: number;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Definición de un plugin. Aporta vistas, dependencias y un hook de ciclo de
|
|
815
|
+
* vida `setup`. Open/Closed: añadir funcionalidad = nuevo plugin, sin tocar el core.
|
|
816
|
+
*/
|
|
817
|
+
declare interface PluginDef {
|
|
818
|
+
readonly name: string;
|
|
819
|
+
/** Vistas que registra, indexadas por su `type`. */
|
|
820
|
+
readonly views?: Record<string, ViewSpec>;
|
|
821
|
+
/** Plugins de los que depende (se cargan antes). */
|
|
822
|
+
readonly deps?: PluginDef[];
|
|
823
|
+
/**
|
|
824
|
+
* Se llama una vez tras montar el calendario, en orden de dependencias.
|
|
825
|
+
* Recibe la API (navegación, eventos vía `on`/`off`, fuentes…) y puede
|
|
826
|
+
* devolver una función de limpieza que se ejecuta al destruir.
|
|
827
|
+
*/
|
|
828
|
+
readonly setup?: (api: CalendarApi) => PluginTeardown;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/** Función de limpieza opcional devuelta por `setup`. */
|
|
832
|
+
declare type PluginTeardown = void | (() => void);
|
|
833
|
+
|
|
834
|
+
export declare interface ReactDayCellContentArg {
|
|
835
|
+
date: Date;
|
|
836
|
+
dayNumber: number;
|
|
837
|
+
isToday: boolean;
|
|
838
|
+
isOther: boolean;
|
|
839
|
+
view: RsvViewApi;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export declare interface ReactDayHeaderContentArg {
|
|
843
|
+
date: Date;
|
|
844
|
+
text: string;
|
|
845
|
+
dayOfWeek: number;
|
|
846
|
+
dayNumber: number;
|
|
847
|
+
isToday: boolean;
|
|
848
|
+
view: RsvViewApi;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export declare interface ReactEventContentArg {
|
|
852
|
+
event: RsvEventApi;
|
|
853
|
+
isAllDay: boolean;
|
|
854
|
+
timeText: string;
|
|
855
|
+
view: RsvViewApi;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export declare interface ReactMoreLinkContentArg {
|
|
859
|
+
date: Date;
|
|
860
|
+
moreCount: number;
|
|
861
|
+
allEvents: RsvEventApi[];
|
|
862
|
+
hiddenEvents: RsvEventApi[];
|
|
863
|
+
view: RsvViewApi;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
export declare interface ReactSlotLabelContentArg {
|
|
867
|
+
text: string;
|
|
868
|
+
minutes: number;
|
|
869
|
+
isMajor: boolean;
|
|
870
|
+
view: RsvViewApi;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
declare type RecurrenceDef = SimpleRecurrence | RRuleRecurrence;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Componente React de Reservi Calendar. API deliberadamente compatible con
|
|
877
|
+
* `@fullcalendar/react`: mismos nombres de opciones, callbacks como props,
|
|
878
|
+
* `ref.getApi()` y render props que devuelven JSX.
|
|
879
|
+
*
|
|
880
|
+
* Internamente monta la capa agnóstica (Preact) y pinta los render props en el
|
|
881
|
+
* árbol de React mediante portales, así que el contenido de los eventos
|
|
882
|
+
* conserva el contexto de React (stores, i18n, theme…).
|
|
883
|
+
*/
|
|
884
|
+
export declare const ReserviCalendar: ForwardRefExoticComponent<ReserviCalendarProps & RefAttributes<ReserviCalendarRef>>;
|
|
885
|
+
|
|
886
|
+
/** Opciones de la capa Preact = opciones de núcleo + presentación. */
|
|
887
|
+
export declare interface ReserviCalendarOptions extends CalendarOptions {
|
|
888
|
+
slots?: ReserviSlots;
|
|
889
|
+
hooks?: ReserviHooks;
|
|
890
|
+
classNames?: ReserviClassNames;
|
|
891
|
+
/**
|
|
892
|
+
* Puente de render del framework anfitrión. Lo inyecta el wrapper; no es
|
|
893
|
+
* necesario configurarlo a mano en uso vanilla/Preact.
|
|
894
|
+
*/
|
|
895
|
+
hostBridge?: HostBridge;
|
|
896
|
+
/**
|
|
897
|
+
* Vistas a mostrar como pestañas en la segunda fila de la toolbar
|
|
898
|
+
* (p. ej. ["dayGridMonth", "timeGridWeek", "listWeek"]). Si se omite, se
|
|
899
|
+
* derivan de los tokens de `headerToolbar`; si tampoco hay, no se muestra la fila.
|
|
900
|
+
*/
|
|
901
|
+
views?: string[];
|
|
902
|
+
/**
|
|
903
|
+
* Callback del botón "Añadir". Solo si se define se renderiza el botón; el
|
|
904
|
+
* anfitrión decide qué ocurre al pulsarlo (abrir un modal, navegar, etc.).
|
|
905
|
+
*/
|
|
906
|
+
onAddClick?: () => void;
|
|
907
|
+
/** Texto del botón "Añadir" (def. "+" sin etiqueta). */
|
|
908
|
+
addButtonText?: string;
|
|
909
|
+
/**
|
|
910
|
+
* Cambia de vista automáticamente al redimensionar el contenedor (p. ej.
|
|
911
|
+
* mes → lista en mobile). Se evalúa el `breakpoint` más alto que sea
|
|
912
|
+
* `<= ancho actual` (estilo media query `min-width`).
|
|
913
|
+
*/
|
|
914
|
+
responsiveViews?: {
|
|
915
|
+
breakpoint: number;
|
|
916
|
+
view: string;
|
|
917
|
+
}[];
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export declare interface ReserviCalendarProps extends BaseOptions {
|
|
921
|
+
eventClick?: (arg: EventClickArg) => void;
|
|
922
|
+
dateClick?: (arg: DateClickArg) => void;
|
|
923
|
+
select?: (arg: SelectArg) => void;
|
|
924
|
+
unselect?: () => void;
|
|
925
|
+
datesSet?: (arg: DatesSetArg) => void;
|
|
926
|
+
eventsSet?: (events: RsvEventApi[]) => void;
|
|
927
|
+
eventDrop?: (arg: EventChangeArg) => void;
|
|
928
|
+
eventResize?: (arg: EventChangeArg) => void;
|
|
929
|
+
eventChange?: (arg: EventChangeArg) => void;
|
|
930
|
+
moreLinkClick?: (arg: MoreLinkClickArg) => void;
|
|
931
|
+
navLinkDay?: (arg: {
|
|
932
|
+
date: Date;
|
|
933
|
+
dateStr: string;
|
|
934
|
+
}) => void;
|
|
935
|
+
loading?: (isLoading: boolean) => void;
|
|
936
|
+
eventContent?: (arg: ReactEventContentArg) => ReactNode;
|
|
937
|
+
dayCellContent?: (arg: ReactDayCellContentArg) => ReactNode;
|
|
938
|
+
dayHeaderContent?: (arg: ReactDayHeaderContentArg) => ReactNode;
|
|
939
|
+
slotLabelContent?: (arg: ReactSlotLabelContentArg) => ReactNode;
|
|
940
|
+
moreLinkContent?: (arg: ReactMoreLinkContentArg) => ReactNode;
|
|
941
|
+
eventDidMount?: (arg: ReactEventContentArg & {
|
|
942
|
+
el: HTMLElement;
|
|
943
|
+
}) => void;
|
|
944
|
+
dayCellDidMount?: (arg: ReactDayCellContentArg & {
|
|
945
|
+
el: HTMLElement;
|
|
946
|
+
}) => void;
|
|
947
|
+
dayHeaderDidMount?: (arg: ReactDayHeaderContentArg & {
|
|
948
|
+
el: HTMLElement;
|
|
949
|
+
}) => void;
|
|
950
|
+
slotLabelDidMount?: (arg: ReactSlotLabelContentArg & {
|
|
951
|
+
el: HTMLElement;
|
|
952
|
+
}) => void;
|
|
953
|
+
/** Se invoca con la API del calendario tras montar. */
|
|
954
|
+
onReady?: (api: CalendarApi) => void;
|
|
955
|
+
/** Clase del contenedor host. */
|
|
956
|
+
className?: string;
|
|
957
|
+
/** Estilos en línea del contenedor host. */
|
|
958
|
+
style?: CSSProperties;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/** Handle imperativo: `ref.current.getApi()`, como en `@fullcalendar/react`. */
|
|
962
|
+
export declare interface ReserviCalendarRef {
|
|
963
|
+
getApi(): CalendarApi | null;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/** Clases por slot, fusionadas con las base. */
|
|
967
|
+
export declare interface ReserviClassNames {
|
|
968
|
+
root?: string;
|
|
969
|
+
toolbar?: string;
|
|
970
|
+
/** Celda de día (dayGrid/multiMonth). */
|
|
971
|
+
day?: string;
|
|
972
|
+
event?: string;
|
|
973
|
+
/** Cabecera de día (nombre del día / columna). */
|
|
974
|
+
dayHeader?: string;
|
|
975
|
+
/** Etiqueta del eje horario (timeGrid). */
|
|
976
|
+
slotLabel?: string;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Hooks de ciclo de vida sobre el DOM ya montado (equivalentes a los
|
|
981
|
+
* `*DidMount` de FullCalendar). Se invocan UNA vez por elemento del DOM.
|
|
982
|
+
*/
|
|
983
|
+
declare interface ReserviHooks {
|
|
984
|
+
eventDidMount?: (arg: EventContentArg & {
|
|
985
|
+
el: HTMLElement;
|
|
986
|
+
}) => void;
|
|
987
|
+
dayCellDidMount?: (arg: DayCellContentArg & {
|
|
988
|
+
el: HTMLElement;
|
|
989
|
+
}) => void;
|
|
990
|
+
dayHeaderDidMount?: (arg: DayHeaderContentArg & {
|
|
991
|
+
el: HTMLElement;
|
|
992
|
+
}) => void;
|
|
993
|
+
slotLabelDidMount?: (arg: SlotLabelContentArg & {
|
|
994
|
+
el: HTMLElement;
|
|
995
|
+
}) => void;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* Slots de render (patrón de "content" de FullCalendar). Cada slot devuelve
|
|
1000
|
+
* contenido Preact, una cadena, o `hostSlot(...)` para delegar en el anfitrión.
|
|
1001
|
+
*/
|
|
1002
|
+
export declare interface ReserviSlots {
|
|
1003
|
+
eventContent?: (arg: EventContentArg) => SlotResult;
|
|
1004
|
+
dayCellContent?: (arg: DayCellContentArg) => SlotResult;
|
|
1005
|
+
dayHeaderContent?: (arg: DayHeaderContentArg) => SlotResult;
|
|
1006
|
+
/** Personaliza la etiqueta del eje horario (timeGrid). */
|
|
1007
|
+
slotLabelContent?: (arg: SlotLabelContentArg) => SlotResult;
|
|
1008
|
+
/**
|
|
1009
|
+
* Personaliza el contenido del botón "+N more" (dayGrid/multiMonth). El
|
|
1010
|
+
* `<button>` que abre el popover se conserva; el slot solo reemplaza su
|
|
1011
|
+
* contenido interno (mismo patrón que `dayCellContent`).
|
|
1012
|
+
*/
|
|
1013
|
+
moreLinkContent?: (arg: MoreLinkContentArg) => SlotResult;
|
|
1014
|
+
/**
|
|
1015
|
+
* Contenido libre al inicio de la toolbar (zona "Filtrar/Personal" del diseño).
|
|
1016
|
+
* El usuario decide qué botones poner y qué hacen; si no se define, no se
|
|
1017
|
+
* renderiza nada en esa zona.
|
|
1018
|
+
*/
|
|
1019
|
+
toolbarStart?: () => SlotResult;
|
|
1020
|
+
/**
|
|
1021
|
+
* Contenido libre al final de la toolbar, antes del botón "Añadir".
|
|
1022
|
+
* Útil para acciones extra propias del anfitrión.
|
|
1023
|
+
*/
|
|
1024
|
+
toolbarEnd?: () => SlotResult;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Tokens de theme programáticos. Permiten construir un theme personalizado en
|
|
1029
|
+
* JS/TS y aplicarlo inline (sin tocar CSS). Los valores por defecto y los themes
|
|
1030
|
+
* pre-hechos viven en @reservi/theme (CSS). Ver THEMES.md.
|
|
1031
|
+
*/
|
|
1032
|
+
export declare interface ReserviThemeTokens {
|
|
1033
|
+
bg?: string;
|
|
1034
|
+
surface?: string;
|
|
1035
|
+
border?: string;
|
|
1036
|
+
muted?: string;
|
|
1037
|
+
text?: string;
|
|
1038
|
+
primary?: string;
|
|
1039
|
+
primaryFg?: string;
|
|
1040
|
+
today?: string;
|
|
1041
|
+
event1?: string;
|
|
1042
|
+
event2?: string;
|
|
1043
|
+
event3?: string;
|
|
1044
|
+
event4?: string;
|
|
1045
|
+
event5?: string;
|
|
1046
|
+
eventFg?: string;
|
|
1047
|
+
now?: string;
|
|
1048
|
+
selection?: string;
|
|
1049
|
+
nonbusiness?: string;
|
|
1050
|
+
radius?: string;
|
|
1051
|
+
radiusEvent?: string;
|
|
1052
|
+
slotHeight?: string;
|
|
1053
|
+
fontSans?: string;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
declare interface ResourceDayGridColumn {
|
|
1057
|
+
readonly row: ResourceRow;
|
|
1058
|
+
readonly events: EventDef[];
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
declare interface ResourceDayGridModel {
|
|
1062
|
+
readonly date: RsvDate;
|
|
1063
|
+
readonly columns: ResourceDayGridColumn[];
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
declare interface ResourceDayGridMonthCell {
|
|
1067
|
+
readonly date: RsvDate;
|
|
1068
|
+
readonly isToday: boolean;
|
|
1069
|
+
/** No pertenece al mes "actual" (días de relleno). */
|
|
1070
|
+
readonly isOther: boolean;
|
|
1071
|
+
readonly columns: ResourceDayGridMonthColumn[];
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
declare interface ResourceDayGridMonthColumn {
|
|
1075
|
+
readonly row: ResourceRow;
|
|
1076
|
+
/** Eventos visibles ese día para este recurso (ya recortados por dayMaxEvents). */
|
|
1077
|
+
readonly events: EventDef[];
|
|
1078
|
+
/** Eventos ocultos por el límite (cuentan para "+N more"). */
|
|
1079
|
+
readonly hiddenEvents: EventDef[];
|
|
1080
|
+
readonly moreCount: number;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
declare interface ResourceDayGridMonthModel {
|
|
1084
|
+
readonly weeks: ResourceDayGridMonthWeek[];
|
|
1085
|
+
/** Columnas de día visibles por semana (7 menos los días ocultos). */
|
|
1086
|
+
readonly columnCount: number;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
declare interface ResourceDayGridMonthWeek {
|
|
1090
|
+
readonly days: ResourceDayGridMonthCell[];
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
/** Recurso normalizado del dominio. */
|
|
1094
|
+
declare interface ResourceDef {
|
|
1095
|
+
readonly id: string;
|
|
1096
|
+
readonly title: string;
|
|
1097
|
+
readonly parentId: string | null;
|
|
1098
|
+
readonly eventColor: string | null;
|
|
1099
|
+
readonly extendedProps: Record<string, unknown>;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/** Recurso de entrada (Scheduler). Admite jerarquía por `children` o `parentId`. */
|
|
1103
|
+
export declare interface ResourceInput {
|
|
1104
|
+
id: string;
|
|
1105
|
+
title?: string;
|
|
1106
|
+
parentId?: string;
|
|
1107
|
+
children?: ResourceInput[];
|
|
1108
|
+
eventColor?: string;
|
|
1109
|
+
extendedProps?: Record<string, unknown>;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Plugin Resource: vistas de recursos (Scheduler). Premium en FullCalendar;
|
|
1114
|
+
* aquí gratis y MIT. Depende de timeline.
|
|
1115
|
+
*/
|
|
1116
|
+
export declare const resourcePlugin: PluginDef;
|
|
1117
|
+
|
|
1118
|
+
/** Fila de recurso aplanada para render (con profundidad y estado). */
|
|
1119
|
+
declare interface ResourceRow {
|
|
1120
|
+
readonly resource: ResourceDef;
|
|
1121
|
+
readonly depth: number;
|
|
1122
|
+
readonly hasChildren: boolean;
|
|
1123
|
+
readonly expanded: boolean;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
declare interface ResourceTimeGridColumn {
|
|
1127
|
+
readonly row: ResourceRow;
|
|
1128
|
+
readonly allDayEvents: EventDef[];
|
|
1129
|
+
readonly timedSegs: TimeGridSeg[];
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
declare interface ResourceTimeGridModel {
|
|
1133
|
+
readonly date: RsvDate;
|
|
1134
|
+
readonly slots: TimeGridSlot[];
|
|
1135
|
+
readonly columns: ResourceTimeGridColumn[];
|
|
1136
|
+
readonly minMinutes: number;
|
|
1137
|
+
readonly maxMinutes: number;
|
|
1138
|
+
/** % desde arriba del indicador de ahora (compartido), o null. */
|
|
1139
|
+
readonly nowTopPct: number | null;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
declare interface ResourceTimelineLane {
|
|
1143
|
+
readonly row: ResourceRow;
|
|
1144
|
+
readonly segs: TimelineSeg[];
|
|
1145
|
+
readonly laneCount: number;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
declare interface ResourceTimelineModel {
|
|
1149
|
+
readonly slots: TimelineSlot[];
|
|
1150
|
+
readonly lanes: ResourceTimelineLane[];
|
|
1151
|
+
readonly hourly: boolean;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/** Recurrencia RRULE (RFC 5545, subconjunto). */
|
|
1155
|
+
declare interface RRuleRecurrence {
|
|
1156
|
+
readonly kind: "rrule";
|
|
1157
|
+
readonly freq: "DAILY" | "WEEKLY" | "MONTHLY" | "YEARLY";
|
|
1158
|
+
readonly interval: number;
|
|
1159
|
+
readonly count: number | null;
|
|
1160
|
+
readonly until: string | null;
|
|
1161
|
+
/** Días (0=domingo…6=sábado) para FREQ=WEEKLY;BYDAY. */
|
|
1162
|
+
readonly byDay: number[] | null;
|
|
1163
|
+
readonly durationMin: number;
|
|
1164
|
+
readonly exdate: string[];
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Fecha del dominio. Tipo OPACO: el dominio nunca inspecciona su interior,
|
|
1169
|
+
* solo la pasa de vuelta a los métodos del DatePort. El adaptador es el único
|
|
1170
|
+
* que conoce su representación real (una instancia inmutable de time-guard).
|
|
1171
|
+
*/
|
|
1172
|
+
declare type RsvDate = {
|
|
1173
|
+
readonly __brand: "RsvDate";
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
/** Evento tal como lo recibe el anfitrión (equivalente a `EventApi`). */
|
|
1177
|
+
export declare interface RsvEventApi {
|
|
1178
|
+
readonly id: string;
|
|
1179
|
+
readonly groupId: string;
|
|
1180
|
+
readonly title: string;
|
|
1181
|
+
readonly start: Date | null;
|
|
1182
|
+
readonly end: Date | null;
|
|
1183
|
+
readonly startStr: string;
|
|
1184
|
+
readonly endStr: string;
|
|
1185
|
+
readonly allDay: boolean;
|
|
1186
|
+
readonly url: string;
|
|
1187
|
+
readonly display: string;
|
|
1188
|
+
readonly backgroundColor: string;
|
|
1189
|
+
readonly borderColor: string;
|
|
1190
|
+
readonly textColor: string;
|
|
1191
|
+
readonly classNames: string[];
|
|
1192
|
+
readonly extendedProps: Record<string, unknown>;
|
|
1193
|
+
/** Definición original del núcleo, por si se necesita la API completa. */
|
|
1194
|
+
readonly def: EventDef;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/** Rango semiabierto [start, end). */
|
|
1198
|
+
declare interface RsvRange {
|
|
1199
|
+
readonly start: RsvDate;
|
|
1200
|
+
readonly end: RsvDate;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/** Vista activa (equivalente reducido de `ViewApi`). */
|
|
1204
|
+
export declare interface RsvViewApi {
|
|
1205
|
+
readonly type: string;
|
|
1206
|
+
readonly title?: string;
|
|
1207
|
+
readonly currentStart?: Date;
|
|
1208
|
+
readonly currentEnd?: Date;
|
|
1209
|
+
readonly activeStart?: Date;
|
|
1210
|
+
readonly activeEnd?: Date;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
export declare interface SelectArg {
|
|
1214
|
+
start: Date;
|
|
1215
|
+
end: Date;
|
|
1216
|
+
startStr: string;
|
|
1217
|
+
endStr: string;
|
|
1218
|
+
view: RsvViewApi;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
declare interface Selection_2 {
|
|
1222
|
+
start: RsvDate;
|
|
1223
|
+
end: RsvDate;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/** Recurrencia simple (días de la semana + franja horaria). */
|
|
1227
|
+
declare interface SimpleRecurrence {
|
|
1228
|
+
readonly kind: "simple";
|
|
1229
|
+
readonly daysOfWeek: number[];
|
|
1230
|
+
readonly startTimeMin: number;
|
|
1231
|
+
readonly durationMin: number;
|
|
1232
|
+
readonly startRecur: string | null;
|
|
1233
|
+
readonly endRecur: string | null;
|
|
1234
|
+
readonly exdate: string[];
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
/** Argumento del slot de etiqueta del eje horario (timeGrid). */
|
|
1238
|
+
declare interface SlotLabelContentArg {
|
|
1239
|
+
/** Texto ya formateado (p. ej. "09:00"). */
|
|
1240
|
+
text: string;
|
|
1241
|
+
/** Minutos desde medianoche del slot. */
|
|
1242
|
+
minutes: number;
|
|
1243
|
+
/** Si es una marca mayor (etiquetada). */
|
|
1244
|
+
isMajor: boolean;
|
|
1245
|
+
view: ViewArg;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
declare type SlotResult = ComponentChildren | string | HostSlotResult;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Algoritmo de columnas para eventos solapados (interval graph coloring).
|
|
1252
|
+
* Puro y testeable. Devuelve, por evento, su columna y el nº total de columnas
|
|
1253
|
+
* de su grupo de solapamiento.
|
|
1254
|
+
*/
|
|
1255
|
+
declare interface Spanned {
|
|
1256
|
+
startMin: number;
|
|
1257
|
+
endMin: number;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
declare interface TimeGridDay {
|
|
1261
|
+
readonly date: RsvDate;
|
|
1262
|
+
readonly isToday: boolean;
|
|
1263
|
+
readonly isWeekend: boolean;
|
|
1264
|
+
readonly allDayEvents: EventDef[];
|
|
1265
|
+
readonly timedSegs: TimeGridSeg[];
|
|
1266
|
+
/** Rango laborable en % [topPct, bottomPct] para sombrear; null si no aplica. */
|
|
1267
|
+
readonly businessPct: {
|
|
1268
|
+
topPct: number;
|
|
1269
|
+
bottomPct: number;
|
|
1270
|
+
} | null;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
declare interface TimeGridModel {
|
|
1274
|
+
readonly slots: TimeGridSlot[];
|
|
1275
|
+
readonly days: TimeGridDay[];
|
|
1276
|
+
readonly minMinutes: number;
|
|
1277
|
+
readonly maxMinutes: number;
|
|
1278
|
+
readonly slotDurationMin: number;
|
|
1279
|
+
readonly nowIndicator: NowIndicator | null;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Plugin TimeGrid: vistas con eje temporal vertical. Solo declara las specs;
|
|
1284
|
+
* el render vive en @reservi/preact.
|
|
1285
|
+
*/
|
|
1286
|
+
export declare const timeGridPlugin: PluginDef;
|
|
1287
|
+
|
|
1288
|
+
declare interface TimeGridSeg extends Spanned {
|
|
1289
|
+
readonly event: EventDef;
|
|
1290
|
+
/** % desde arriba (0–100) dentro del área de tiempo. */
|
|
1291
|
+
readonly topPct: number;
|
|
1292
|
+
readonly heightPct: number;
|
|
1293
|
+
readonly col: number;
|
|
1294
|
+
readonly colCount: number;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
declare interface TimeGridSlot {
|
|
1298
|
+
/** Minutos desde slotMinTime. */
|
|
1299
|
+
readonly offsetMin: number;
|
|
1300
|
+
readonly label: string;
|
|
1301
|
+
/** Slot mayor (coincide con slotLabelInterval): lleva etiqueta. */
|
|
1302
|
+
readonly isMajor: boolean;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
declare interface TimelineModel {
|
|
1306
|
+
readonly slots: TimelineSlot[];
|
|
1307
|
+
readonly segs: TimelineSeg[];
|
|
1308
|
+
readonly laneCount: number;
|
|
1309
|
+
readonly hourly: boolean;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/** Plugin Timeline: eje temporal horizontal (premium en FullCalendar; aquí gratis). */
|
|
1313
|
+
export declare const timelinePlugin: PluginDef;
|
|
1314
|
+
|
|
1315
|
+
declare interface TimelineSeg {
|
|
1316
|
+
readonly event: EventDef;
|
|
1317
|
+
readonly leftPct: number;
|
|
1318
|
+
readonly widthPct: number;
|
|
1319
|
+
/** Carril (fila) para evitar solape horizontal. */
|
|
1320
|
+
readonly lane: number;
|
|
1321
|
+
readonly laneCount: number;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
declare interface TimelineSlot {
|
|
1325
|
+
readonly leftPct: number;
|
|
1326
|
+
readonly label: string;
|
|
1327
|
+
readonly isMajor: boolean;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
/** Secciones de la toolbar (tokens separados por espacios). */
|
|
1331
|
+
declare interface ToolbarOptions {
|
|
1332
|
+
start?: string;
|
|
1333
|
+
center?: string;
|
|
1334
|
+
end?: string;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/** Vista activa tal como la reciben los slots y los hooks `*DidMount`. */
|
|
1338
|
+
declare interface ViewArg {
|
|
1339
|
+
readonly type: string;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/** Familia de vista (cómo se renderiza). */
|
|
1343
|
+
declare type ViewKind = "dayGrid" | "timeGrid" | "list" | "multiMonth" | "timeline" | "resource" | "resourceTimeGrid" | "resourceDayGrid" | "resourceDayGridMonth";
|
|
1344
|
+
|
|
1345
|
+
/** Modelo de la vista actual que consume la capa de UI. */
|
|
1346
|
+
declare interface ViewModel {
|
|
1347
|
+
readonly type: string;
|
|
1348
|
+
readonly spec: ViewSpec;
|
|
1349
|
+
readonly range: DateRange;
|
|
1350
|
+
readonly title: string;
|
|
1351
|
+
/** Presente solo para vistas dayGrid. */
|
|
1352
|
+
readonly dayGrid?: DayGridModel;
|
|
1353
|
+
/** Presente solo para vistas timeGrid. */
|
|
1354
|
+
readonly timeGrid?: TimeGridModel;
|
|
1355
|
+
/** Presente solo para vistas list. */
|
|
1356
|
+
readonly list?: ListModel;
|
|
1357
|
+
/** Presente solo para vistas multiMonth. */
|
|
1358
|
+
readonly multiMonth?: MultiMonthModel;
|
|
1359
|
+
/** Presente solo para vistas timeline. */
|
|
1360
|
+
readonly timeline?: TimelineModel;
|
|
1361
|
+
/** Presente solo para vistas resource (resource-timeline). */
|
|
1362
|
+
readonly resourceTimeline?: ResourceTimelineModel;
|
|
1363
|
+
/** Presente solo para vistas resourceTimeGrid (recursos como columnas). */
|
|
1364
|
+
readonly resourceTimeGrid?: ResourceTimeGridModel;
|
|
1365
|
+
/** Presente solo para vistas resourceDayGrid. */
|
|
1366
|
+
readonly resourceDayGrid?: ResourceDayGridModel;
|
|
1367
|
+
/** Presente solo para vistas resourceDayGridMonth. */
|
|
1368
|
+
readonly resourceDayGridMonth?: ResourceDayGridMonthModel;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/** Definición declarativa de una vista (la aporta un plugin). */
|
|
1372
|
+
declare interface ViewSpec {
|
|
1373
|
+
/** Nombre único, p. ej. "dayGridMonth". */
|
|
1374
|
+
readonly type: string;
|
|
1375
|
+
/** Familia de render. */
|
|
1376
|
+
readonly kind: ViewKind;
|
|
1377
|
+
/** Duración del rango que abarca la vista. */
|
|
1378
|
+
readonly duration: Duration;
|
|
1379
|
+
/** Días ocultos por defecto en esta vista (0=domingo…6=sábado). */
|
|
1380
|
+
readonly hiddenDays?: number[];
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
export { }
|